Finish off vector destructuring features.
This commit is contained in:
@@ -4,8 +4,21 @@
|
||||
[:foo :bar]))
|
||||
|
||||
"Whether in function definitions"
|
||||
(= "First comes love, then comes marriage, then comes Clojure with the baby carriage"
|
||||
(= (str "First comes love, "
|
||||
"then comes marriage, "
|
||||
"then comes Clojure with the baby carriage")
|
||||
((fn [[a b c]] __)
|
||||
["love" "marriage" "Clojure"]))
|
||||
|
||||
"Or in let expressions"
|
||||
(= "Rich Hickey aka The Clojurer aka Go Time aka Macro Killah"
|
||||
(let [[first-name last-name & aliases]
|
||||
(list "Rich" "Hickey" "The Clojurer" "Go Time" "Macro Killah")]
|
||||
__))
|
||||
|
||||
"You can regain the full argument if you like arguing"
|
||||
(= {:original-parts ["Steven" "Hawking"] :named-parts {:first "Steven" :last "Hawking"}}
|
||||
(let [[first-name last-name :as full-name] ["Steven" "Hawking"]]
|
||||
__))
|
||||
|
||||
)
|
||||
|
Reference in New Issue
Block a user