3 ms·
I disagree that Clojure's AST changes are gratuitous. Rich has repeatedly provided his reasons for them. You may think they are bad reasons, but it's not like
by aidenn0 9y ago
I disagree that Clojure's AST changes are gratuitous. Rich has repeatedly provided his reasons for them. You may think they are bad reasons, but it's not like he just said "ZOMG there are too many parens!"
That being said, I tend to use destructuring in common-lisp, and if you are taking an element from a collection by using c*r then you are probably doing it wrong.
Optima has more complete support for destructuring, but this works just fine in CL with out any libraries:
(let ((some-plist '(:foo 1 :bar 2)))
(destructuring-bind (&key foo &allow-other-keys) some-plist
foo))
- deleted 9y ago[deleted]
- kbp 9y agoAnd while it didn't make it into the Common Lisp version of LET, there were versions in earlier dialects that supported destructuring. For example, the Maclisp reference manual's description of LET[0] says: It is permissible to place an s-expression pattern in place of a symbol in the (sym init) form of an element of the bvlspec. The symbols in the pattern will become bound to the matching elements of the initialization (see DESETQ). This kind of pattern-matched assignment is called destructuring. (let (((a b) '(1 2))) (cons b a)) => (2 . 1) 0: http://www.maclisp.info/pitmanual/contro.html#5.6.1 http://www.maclisp.info/pitmanual/contro.html#5.6.1