Multiple-argument #() syntax.

master
Colin Jones 14 years ago
parent 7e6ac00457
commit b340cb6ccb

@ -13,6 +13,9 @@
"Or using even shorter syntax" "Or using even shorter syntax"
(= __ (#(* 15 %) __)) (= __ (#(* 15 %) __))
"Short anonymous functions may take multiple arguments"
(= __ (#(+ %1 %2 %3) 4 5 6))
"One function can beget another" "One function can beget another"
(= __ ((fn [] (= __ ((fn []
((fn [a b] (__ a b)) ((fn [a b] (__ a b))

@ -54,6 +54,7 @@
"functions" {"__" [20 "functions" {"__" [20
10 5 10 5
30 2 30 2
15
20 "*"] 20 "*"]
"___" ['(fn [f] (f 5)) "___" ['(fn [f] (f 5))
'(fn [f] 25)]} '(fn [f] 25)]}

Loading…
Cancel
Save