-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Destructuring #11
Comments
I'm very interested in this feature. How complex do you think it would be to implement in terms of sweet.js macros/rules? |
Got this
working with this 5fd812b commit (works only for nested vector in a let form). It's a start, I'm quite impressed at how little code it took with sweet.js. |
And here's fe371c0 destructuring of maps (mixed with vectors) in let forms:
Well, that does it (for mori data structures and literals - we could probably consider adding destructuring with js array and object literals Now I have to figure out how to call the _destr macro in
Anywhere else? |
From [http://clojure.org/special_forms#Special Forms--Binding Forms (Destructuring)](http://clojure.org/special_forms#Special Forms--Binding Forms %28Destructuring%29):
So I think your list had it covered. I have mixed feelings about letc, it's probably really useful for Node.js-style APIs, but does it belong in core? Not that it's expensive to have it there, though. Destructuring JS arrays/objects sounds interesting (and would actually give ki an edge over vanilla cljs), but probably not high-priority for now :) |
Great, thanks for the quote - somehow it didn't occur to me that I could check on the Clojure website. I feel the same way as you do about letc. It's possibly a nice to have, but it could indeed belong to an external macro library if we have enough of them at some point. As for the JS arrays/objects destructuring, I just added it: 6ac7006 |
Consider introducing destructuring.
The text was updated successfully, but these errors were encountered: