Jacek Generowicz <jacek.generow...@googlemail.com> writes:

> (def ++ +)
> (defn foo-core [a b] (+  a b))
> (defn foo-user [a b] (++ a b))
> (binding [+  -
>         ++ -]
>   [(foo-core 1 1) (foo-user 1 1)])
>
> Gives the result:
>
>     [2 0]
>
> which suggests that some vars are immune to binding.
>
> Could someone please point me to the chapter and verse describing this?

This is also affected by direct binding. It's not documented anywhere
outside the IRC logs to my knowledge, but if you look at line 2818 of
Compiler.java you can see the criteria whereby certain vars are made
"direct", improving the call-time performance, but making it impossible
to rebind them.

Currently all vars inside a namespace that begins with clojure with root
bindings that are functions are subject to this feature, though this
criteria will hopefully change in the future.

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