On Sunday, March 24, 2013 10:53:28 AM UTC+1, bsmith.occs wrote:

> Way back when I started with Clojure i was doing this:
>
> (let [constant-data (something-expensive)]
>   (defn my-fn [x]
>     (do-something-with x constant-data)))
>
> But was advised instead to do this:
>
> (def my-fn
>   (let [constant-data (something-expensive)]
>     (fn [x]
>       (do-something-with x constant-data))))
>

The problem with this is that it gets messy when setting up metadata is 
involved. 

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to