Hi,
I found this old post:
http://groups.google.com/group/clojure/browse_thread/thread/45e118a638a5af8e/02eab5ae0d9023ff?lnk=gst&q=binding+destructuring#02eab5ae0d9023ff
And was wondering what is the status of Stephen's patch?
Is there a reason why clojure/binding does not support destructuring
On Oct 9, 2008, at 3:13 AM, Krukow wrote:
> Hello Stephen.
>
> I am not sure I understand. Your example doesn't seem to suggest that
> you are really needing a form of destructuring. Rather, it looks like
> multiple bindings. Presently, I can do:
>
> krukow:~/languages/clojure/trunk$ cl
> Clojur
On Sep 22, 4:36 am, "Stephen C. Gilardi" <[EMAIL PROTECTED]> wrote:
> 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))
Hello Stephen.
I am not sure I understand.
Rich,
This is code from my socket repl that sparked my interest in support
for destructuring in clojure/binding.
(defn socket-streams ;; returns a vector of 3 streams
[s]
[(LineNumberingPushbackReader. (InputStreamReader. (.getInputStream
s) "UTF-8"))
(OutputSt
On Sep 22, 2008, at 2:27 AM, Stephen C. Gilardi wrote:
> I've uploaded
> http://groups.google.com/group/clojure/web/binding-destructure.patch
> .
I updated the patch to improve readability and uploaded it to:
http://clojure.googlegroups.com/web/bind-destructuring.patch
--Steve
--~-
On Sep 22, 2008, at 12:42 AM, Stephen C. Gilardi wrote:
> It looks like tagging the gensym'd symbols with metadata will work.
> I'm having a go at it.
I've uploaded
http://groups.google.com/group/clojure/web/binding-destructure.patch
.
--Steve
--~--~-~--~~~---
On Sep 21, 2008, at 10:36 PM, Stephen C. Gilardi wrote:
> If it's feasible, it's a feature I'd like to see in Clojure at some
> point.
It looks like tagging the gensym'd symbols with metadata will work.
I'm having a go at it.
--Steve
--~--~-~--~~~---~--~~
Y
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=