Fennel functions created with the lambda keyword throw a runtime error if given a nil argument unless the name is prefixed by ? - super useful!
(lambda [x ?y z] (print (- x (* (or ?y 1) z))))
In this case, x and z are required, y can be nil.
=> More informations about this toot | More toots from Olical@mastodon.social
The tail! marker gives you compile time checking that you haven't broken a tail call!
(fn process-all [data i] (case (process (. data i)) :done (print "Process completed.") :next (process-all data (+ i 1)) :skip (do (tail! (process-all data (+ i 2))) ;; ^^^^^ Compile error: Must be in tail position (print "Skipped" (+ i 1)))))
=> More informations about this toot | More toots from Olical@mastodon.social This content has been proxied by September (3851b).Proxy Information
text/gemini