This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-04-11
Channels
- # announcements (3)
- # asami (4)
- # babashka (79)
- # babashka-sci-dev (47)
- # beginners (97)
- # biff (12)
- # calva (7)
- # clj-commons (3)
- # clj-kondo (22)
- # clj-on-windows (13)
- # cljdoc (31)
- # cljfx (2)
- # cljs-dev (1)
- # clojure (85)
- # clojure-austin (4)
- # clojure-dev (12)
- # clojure-europe (15)
- # clojure-italy (8)
- # clojure-nl (4)
- # clojure-uk (4)
- # community-development (19)
- # conjure (3)
- # core-typed (40)
- # cursive (9)
- # datahike (21)
- # datomic (1)
- # emacs (7)
- # exercism (2)
- # graalvm (20)
- # graphql (1)
- # honeysql (16)
- # jobs (1)
- # malli (2)
- # off-topic (3)
- # pathom (28)
- # pedestal (3)
- # polylith (7)
- # reitit (14)
- # releases (1)
- # remote-jobs (1)
- # rewrite-clj (4)
- # shadow-cljs (21)
- # sql (21)
- # testing (8)
- # tools-deps (23)
- # vscode (8)
- # xtdb (38)
Morning!
Good morning! I'm happy with having taken the next step with the mini-language for Calva document notation: A command that creates VS Code documents from the notation. With this in place users can 1. ”record” the state of some editing session 2. send us the notation 3. we can recreate it, and start investigating the problem. We'll see if it will make the difference I think it will make, regarding bug reports. I am taking the opportunity to celebrate prematurely. 😃
This is the text I produce first in the video clip:
(ns pez.pirate-lang§ (:require [clojure.string :as string]))§§(def english-o {:alphabet "|abcdefghijklmnopqrstuvwxyz"§ :vowels "aeiou"§ :pirate-char "o"})§§(def swedish-o {:alphabet "|1abcdefghijklmnopqrstuvwxyz"§ :vowels "aeiouåäö"§ :pirate-char "o"})§§(defn- configure§ [{:keys [alphabet vowels pirate-char]}]§ (let [alphabet (set (seq (string/upper-case alphabet)))§ vowels (set (seq (string/upper-case vowels)))§ consonants (set (remove vowels alphabet))§ pirates (if (vowels pirate-char)§ vowels§ consonants)]§ {:pirate-char pirate-char§ :pirates pirates}))§§(defn to-pirate-talk§ [text language]§ (let [{:keys [pirate-char pirates]} (configure language)]§ (apply str (mapcat (fn [c]§ (if (pirates (first (string/upper-case c)))§ (interpose pirate-char (repeat 2 c))§ [c]))§ text))))§§(defn from-pirate-talk§ [text language]§ (let [{:keys [pirate-char pirates]} (configure language)§ pattern (re-pattern (str "(?i)([" (apply str pirates) "])" pirate-char "\\1"))]§ (string/replace text pattern "$1")))§§(comment§ (to-pirate-talk "Have you heard about Pirate talk?" english-o)§ ;; => "HoHavove yoyou hohearordod aboboutot PoPiroratote totalolkok?"§§ (from-pirate-talk "HoHavove yoyou hohearordod aboboutot PoPiroratote totalolkok?" english-o)§ ;; => "Have you heard about Pirate talk?"§ )
You can grab the Calva VSIX from this issue https://github.com/BetterThanTomorrow/calva/issues/1662 And recreate the document from the above text. 😃
måning
morning!