github babashka/babashka v0.0.29

latest releases: v1.12.196, v1.12.195, v1.12.194...
pre-release5 years ago

New

  • #112: Add binding, with-out-str and with-in-str:
$ ./bb '(let [w (java.io.StringWriter.)] (binding [*out* w] (println "hello")) (str w))'
"hello\n"

$ ./bb "(count (with-out-str (println \"hello\")))"
6

$ ./bb '(with-in-str "hi" (read-line))'
"hi"

Notes:

  • Currently binding only works with clojure.core/*in* and clojure.core/*out*
  • *in* has a special meaning in babashka expressions, but you can refer to Clojure's *in*by fully qualifying it: clojure.core/*in*.

Don't miss a new babashka release

NewReleases is sending notifications on new releases.