Skip to content

Instantly share code, notes, and snippets.

Created January 4, 2013 15:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/4453240 to your computer and use it in GitHub Desktop.
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?
;;; 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