Your original understanding is correct. Your first example is not
working the way you expect it because Clojure is inlining "inc" for
speed purposes.

Hope that helps
 -Patrick

On Sep 3, 11:21 pm, Yang Dong <ydong.pub...@gmail.com> wrote:
> (binding [inc dec]
>   (println (inc 1)))
>
> ;=> 2
>
> If I put a declare on top of it,
>
> (declare inc)
>
> (binding [inc dec]
>   (println (inc 1)))
>
> ;=> 0
>
> Originally I thought binding is equal to thread local dynamic binding.
> Seems I was wrong. It seems like it has something to do with
> namespaces. Right?

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