yamlscript 2023-12-13

The tree program is so much better now that the original Dec 1 version.

Implement as you blog :\

Posted this in #clojure but I just got let bindings and lambda functions working in YS! Here's an example of using let-over-lambda closures in YS:

$ cat sample/lol.ys 
!yamlscript/v0

defn lol(x):
  y =: 2 * x
  =>: \(% + y)

say:
  lol(10): 4
$ ys --compile sample/lol.ys 
(defn lol [x] (let [y (_* 2 x)] (fn [_1] (+ _1 y))))
(say ((lol 10) 4))
$ ys sample/lol.ys 
24

👀 1