I was surprised that clojure/binding doesn't support destructuring bind:
Clojure
user=> (def a)
#'user/a
user=> (def b)
#'user/b
user=> (binding [[a b] [1 2]] (+ a b))
java.lang.ClassCastException: clojure.lang.LazilyPersistentVector
cannot be cast to clojure.lang.Symbol (NO_SOURCE_FILE:3)
user=>
I took a look at implementing it and it looks non-trivial. The vector
emitted by destructure contains a mixture of bindings for generated
symbols and bindings for the target symbols. If one could reliably
identify the generated symbols, it would be possible to put the call
to var-ize inside a destructured let of the same bindings to produce,
e.g., {(var a) a (var b) b}, etc. to pass along to pushThreadBindings.
If it's feasible, it's a feature I'd like to see in Clojure at some
point.
--Steve
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---