5 ms·
# is used for lambda shorthand in Clojure. #(+ % %2) is shorthand for (fn [x y] (+ x y)).
by Zak 16y ago
# is used for lambda shorthand in Clojure. #(+ % %2) is shorthand for (fn [x y] (+ x y)).
- cabalamat 16y agoThat's a nice shorthand. AIUI, Arc uses [... _ ....] as a terse shorthand for closures, but can only deal with functions that take one argument that way -- though it would be simple to expand Arc so it could say [+ _ _2]. Now I've thought about it, I may add something similar as syntax in Unify: (tn + _ _2) (where tn stands for "terse function")