On Sun, Nov 15, 2009 at 7:32 PM, Alex Osborne <[email protected]> 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.
> >
> > Is this possible? I know that I can just inert literal into my let,
> > but that degrades performance, when function is called many times.
> >
> > I would like to have something like static local variable in C++, or
> > just regular constant local variable in my function.
>
> 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?
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en