Re:Elvish – An experimental Unix shell in Go
by nathell on Saturday July 26, 2014 @05:53PM
(#8090926)
Clojure has -> specifically to facilitate writing pipeline code that doesn't read backwards.
[ Parent
| on HN ]
Re:Elvish – An experimental Unix shell in Go
by tgkokk on Saturday July 26, 2014 @06:11PM
(#8090994)
Or, in this case, ->>:
(def lols (->> strs
(filter #(re-find #"LOL" %))
(map upper-case)
sort))
How I read it: take strs, filter the strings that contain "LOL", turn them into upper case and then sort them. Basically it reads the same as the pipeline example in the README.
Re:Elvish – An experimental Unix shell in Go
by roryokane on Saturday July 26, 2014 @06:14PM
(#8091005)
Right – though for this example, `->>` (http://grimoire.arrdem.com/1.6.0/clojure.core/DASH__GT__GT/) works better than `->`. I created a GitHub issue to tell the creator about it: https://github.com/xiaq/elvish/issues/17.