4 ms·
I've been using Clojure for awhile now and it has never previously occurred to me that you could do: #(foo %2) instead of (fn [_ arg2] (foo arg2)) T
by emidln 12y ago
I've been using Clojure for awhile now and it has never previously occurred to me that you could do:
#(foo %2)
instead of
(fn [_ arg2] (foo arg2))
Thanks!
- yobriefcase 12y agoNeither did I until I started writing about #( and decided to see what would happen. The joys of being nosey.
- da02 12y agoNosey? Or maybe "curious"? Explorer? Pioneer? Either way, thanks for writing about it.
- moomin 12y agoObviously, bear in mind that (comp foo second) may be preferable.
- weavejester 12y agoSlightly different use-case, as: (comp foo second) Is equivalent to: (fn [[_ x]] (foo x)) Not: (fn [_ x] (foo x))
- ar7hur 12y ago+1. How about: (comp foo second list)