Created
January 4, 2013 15:04
-
-
Save anonymous/4453240 to your computer and use it in GitHub Desktop.
Something that has me stumped. A NS with a :gen-class directive and a main. The first version of main doesn't work (it never seems to execute the for loop). The second one works. What am I missing?
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
;;; Some NS which has the gen-class directive | |
(defn -main-that-wont-work [] | |
(let [coll (some-collection-returning-function)] | |
(for [c coll] | |
(transform c) | |
) | |
) | |
) | |
;;; Take 2 | |
(defn -main-that-works [] | |
(let [coll (some-collection-returning-function) | |
transformed (map transform coll)] | |
;;; nothing to do | |
transformed | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment