To redeem myself for the noob threading mistake, *I've implemented Var and 
friends in ClojureScript*:

https://github.com/brandonbloom/clojurescript/compare/8ba4849e60e5957cdac36ef6946c647e824ca3c8...vars

This branch includes (almost) the full set of relevant functionality, but 
for performance and interop reasons, only applies to vars def-ed with 
^:dynamic.

Here's a repl session:

ClojureScript:cljs.user> (def ^:dynamic x "root binding")
(var cljs.user.x)
ClojureScript:cljs.user> x
"root binding"
ClojureScript:cljs.user> #'x
(var cljs.user.x)
ClojureScript:cljs.user> ((binding [x "dynamic binding"] (fn [] x)))
"root binding"
ClojureScript:cljs.user> ((binding [x "dynamic binding"] (bound-fn [] x)))
"dynamic binding"

Complete list of newly supported forms:

   - var
   - alter-root-var
   - bound-fn
   - bound-fn*
   - bound?
   - get-thread-bindings
   - push-thread-bindings
   - thread-bound?
   - var-get
   - var-?
   - with-bindings
   - with-bindings*

I'm filling out my contributor agreement and will start a parallel thread 
on clojure-dev to see if we can get this integrated!

Cheers,
Brandon

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to