On 5 September 2010 07:48, Yang Dong <ydong.pub...@gmail.com> wrote:
> That sounds reasonable. But how would you explain `pmap'? This
> function is not inlined. In fact, every function in clojure.core can't
> be bound without a declare (as far as I have tried). And it seems this
> problem only exists when I tried to bind the core functions. It's ok
> for me to substitute the functions in other namespaces.

When the compiler encounters a non-namespace-qualified symbol in the
code, it first resolves it to a Var. For example, the symbol 'inc
normally gets resolved to #'clojure.core/inc; however, after you
(declare inc) in the user namespace, it resolves to #'user/inc. Calls
going through Vars in clojure.core receive special treatment for
speed, which is why you can't rebind them.

Note that with the upcoming :static functions we'll all be free to
have our Vars behave this way (at a finer, per Var granularity level).

Sincerely,
Michał

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