I'm not sure that this is actually the solution you're looking for, but you can use memoize to execute something only once.
(def once-only (memoize (fn [] (println "Called!")))) (once-only) => "Called!" => nil (once-only) => nil Jonathan On Wed, May 18, 2011 at 4:09 PM, Jason <jasond...@gmail.com> wrote: > hi I have a small problem.. I want to execute a java init function > just once for a scheduler. I have tried defonce and def to do this, > this gets the work done but which is the best way to do it. What i > actually want is run the function once when the jvm starts up problem > with defonce i actually need to call it at-lest once and the def want > work unless i use that that file. can someone help me out on how to go > about this? Thanks > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en