user=> (set! *warn-on-reflection* true)
true
user=> (defn fac [n] (loop [n n r 1] (if (= n 1) r (recur (dec' n) (*'
r n)))))
NO_SOURCE_FILE:5 recur arg for primitive local: r is not matching
primitive, had: Object, needed: long
Auto-boxing loop arg: r
#'user/fac
user=> (fac 40)
815915283247897734345611269596115894272000000000N


Yes!!  Genius!  :D

On Jun 21, 9:55 am, "Heinz N. Gies" <he...@licenser.net> wrote:
> On Jun 21, 2010, at 16:52 , Rich Hickey wrote:
>
> > I've added the speculative analysis required to detect when recur arguments 
> > fail to match the type of primitive loop locals, and recompile the loop 
> > with those loop args boxed. When *warn-on-reflection* is true it will issue 
> > a report that this is happening and why.
>
> > This code is in commit 0df995dc6d31a9f4d0fe199bc63c4abfac7c86b1 on the 
> > equal branch:
>
> >http://github.com/richhickey/clojure/commits/equal
>
> > Rich
>
> Awsome!!!! :)
>
> Regards,
> Heinz

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