Multiple-argument #() syntax.

This commit is contained in:
Colin Jones 2010-11-05 17:33:06 -05:00
parent 7e6ac00457
commit b340cb6ccb
2 changed files with 4 additions and 0 deletions

View File

@ -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))

View File

@ -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)]}