John Harrop wrote: > On Sun, Nov 15, 2009 at 7:32 PM, Alex Osborne <a...@meshy.org > <mailto:a...@meshy.org>> wrote: > > ajuc wrote: > > I would like to somehow hide the global hilbert-map into my function, > > but I can't see how to do that. > > Clojure's name gives a hint as to how do this: use a closure. :-) Just > pull the let outside the defn: > > (let [hilbert-map {...}] > (defn point-to-hilbert [...] > ...)) > > > Has anyone benchmarked this alternative?
On my PC it's indistinguishable from point-to-hilbert-let-from-global and point-to-hilbert-directly-from-global. I get around 750ms +- 20ms for all three of them (after letting the JIT warm up by running a few times). -- 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