Similarly, don't use def inside of a defn.  Use let.

On Tue, Aug 3, 2010 at 9:10 PM, Mark Engelberg <mark.engelb...@gmail.com>wrote:

> On Tue, Aug 3, 2010 at 1:06 PM, Dale <dpar...@ptd.net> wrote:
>
>> This statement is ironic, considering the definition of a functional
>> closure, after which Clojure is presumably named.
>>
>>
> You're missing the point.  A defn inside another defn doesn't do what you
> think it does.  defn always creates a global variable, even when it looks
> like it should create a local.  You can create closures, but you should use
> letfn instead.
>

-- 
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

Reply via email to