I'm getting excited about the next YS release. Lots of great new stuff. One thing I'm really stoked about is ys -x ... (which acts very much like bash -x ...) for printing every form w/ args before evaluating it.
Here's an example:
$ cat sample/rosetta-code/rot-13.ys
!yamlscript/v0
defn main(input='Hello, World!'):
s =: set((\\A .. \\Z) + (\\a .. \\z))
say: cycle(s).drop(13 * 2).zipmap(s).escape(input _)
$
$
$ ys sample/rosetta-code/rot-13.ys 'Uryyb, jbeyq!'
Hello, world!
$
$
$ ys -c sample/rosetta-code/rot-13.ys 'Uryyb, jbeyq!'
(defn
main
([input]
(let
[s (set (add+ (rng \A \Z) (rng \a \z)))]
(say (escape input (zipmap (+drop (cycle s) (mul+ 13 2)) s)))))
([] (main "Hello, World!")))
(apply main ARGS)
$
$
$ ys -x sample/rosetta-code/rot-13.ys 'Uryyb, jbeyq!'
1 >>> let([s (set (add+ (rng \A \Z)) (rn...(Vector 2 items), '(say (escape input (zipm...(List 2 items))
2 >>> rng(\A, \Z)
3 >>> rng(\a, \z)
4 >>> add+('(\A \B \C \D \E \F \G \H \I \J \K \L \M \N \O \P ...(Seq 26 items), '(\a \b \c \d \e \f \g \h \i \j \k \l \m \n \o \p ...(Seq 26 items))
5 >>> set('(\A \B \C \D \E \F \G \H \I \J \K \L \M \N \O \P ...(Seq 52 items))
10 >>> cycle(#{\A \a \B \b \C \c \D \d \E \e \F \f \G \g \H \h ...(Set 52 items))
12 >>> mul+(13, 2)
13 >>> +drop('(\A \a \B \b \C \c \D \d \E \e \F \f \G \g \H \h ...(Seq 999 items), 26)
14 >>> zipmap('(\N \n \O \o \P \p \Q \q \R \r \S \s \T \t \U \u ...(Seq 999 items), #{\A \a \B \b \C \c \D \d \E \e \F \f \G \g \H \h ...(Set 52 items))
15 >>> escape("Uryyb, jbeyq!", {\A \N, \a \n, \B \O, \b \o, \C \P, \c \p, \D \Q, ...(Map 52 items))
16 >>> say("Hello, world!")
Hello, world!I suggested your name to appear as a guest on Jacek Schae's podcast @ingy, it's part of a raffle for a ticket to Clojure Conj
Oh wow. Thank you so much.
I don't think I mentioned it here, but my YS talk proposal for the Conj was not accepted.
sorry to hear that
Not as sorry as me 😕 (but thank you 🙂 )
There are "unsessions"