Fork me on GitHub
#sci
<
2021-09-22
>
borkdude16:09:05

Printing in CLJS now got easier. To enable printing in your SCI environment you can do:

(enable-console-print!)
(sci/alter-var-root sci/print-fn (constantly *print-fn*))
without overriding println etc manually. I'll also update scittle to do this soon. #nbb has already been applied like this. As a consequence (clojure.repl/doc) now works as it should.

🙌 3
cap10morgan19:09:11

If I call (sci/eval-form ctx '(fn [arg] (do-something))) can I then use the return value of that to invoke the anon fn later? Or do I need to bind it to a var in SCI?

borkdude19:09:05

You can just call the function

cap10morgan19:09:27

oh, so like (let [sci-fn (sci/eval-form ctx '(fn [arg] (do-something)))] (sci-fn :arg)) would run the anon fn inside sci?

borkdude21:09:41

ok, I also updated scittle to use the new print-fn solution. 0.0.4 was released