Hi,

On Aug 12, 12:44 pm, Tayssir John Gabbour
<tayssir.j...@googlemail.com> wrote:

> Ok, so a function like + avoids this boxing, because it's really
> replaced by a call to clojure.lang.Numbers.add()... And looking at the
> sourcecode, this is accomplished through :inline. This :inline
> declaration allows + to avoid IFn's rules, because + disappears after
> compiletime.
>
> If correct, that makes sense.

I think, this is what's going on. That also explains
why (+ 1 2 3) is slow, while (+ (+ 1 2) 3) is fast.

The first goes the usual route for function invocation,
ie. boxing is required, while the second gets inlined
and the fast path via c.l.Numbers is used.

Sincerely
Meikel

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