newbie questions about evaluation and -main

35 views
Skip to first unread message

Brian Craft

unread,
Oct 8, 2012, 12:07:47 PM10/8/12
to clo...@googlegroups.com
I started with a db example and dropped this into the core.clj of an 'app' project, just before the defn for -main.

(sql/with-connection db
  (sql/with-query-results rs ["select * from foo limit 3"]
    (dorun (map #(println %) rs))))

On "lein run" this prints three rows, but prints them twice. If I move this inside the defn for -main, it prints them once.

I'm not sure what's going on. Is core.clj is being evaluated twice on the way up?
Reply all
Reply to author
Forward
0 new messages