Created
October 17, 2013 16:18
-
-
Save glv/7027832 to your computer and use it in GitHub Desktop.
Avdi Grimm praised the symmetry of the Clojure version of line sorting (http://devblog.avdi.org/2013/10/16/sorting-lines-in-5-languages/). I thought it would be instructive to show how a more traditional Lispy version, without Clojure's ->> macro, obscures that symmetry.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(spit (nth *command-line-args* 2) | |
(clojure.string/join "\n" | |
(sort (clojure.string/split-lines (slurp (nth *command-line-args* 1)))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment