sci 2023-05-01

is there a way to proxy a clojure dynamic var that is bound to some value outside of sci’s context to a dynamic var of the same name inside sci’s context?

I looked at the docs but I guess I’m not grokking something

okay great I’m JIT binding it now and it works 🙂 thanks borkdude!

👍 1

There is no proxy var that follows the value of the host var, unfortunately. I've considered this but it's a bit complicated. Instead what you can do is the following: https://github.com/babashka/babashka/commit/d27efb137d54b7aa14ed4295f6e7caf272fc2aec

and then i still need to bind it using sci/bindings, correct?

it depends. in the commit I linked what happens is that in the exposed "shell" function, the host dynamic var gets "just in time" bound to the value of the SCI dynamic var. So if the user does in their program (binding [...]) the host function gets to see the right value