On Sun, 20 Jun 2010 13:27:01 -0400
David Nolen <dnolen.li...@gmail.com> wrote:

> On Sun, Jun 20, 2010 at 12:57 PM, Luke VanderHart <luke.vanderh...@gmail.com
> > wrote:
> 
> > anything that would mean I'd have to explain the intricacies of
> > primitives, boxing, hinting and casting in an "Intro to Clojure"
> > course. As much as humanely possible, that should be reserved for the
> > "Performance coding in Clojure" sequel.
> This begs the question: Is loop/recur an advanced / performance coding
> topic?
> 
> (defn fact [n]
>   (reduce *' (range 1 n)))

In this case it isn't, because none of these solutions presented
qualify as a "fast" implementation of factorial. As in most cases, you
don't get real speed by trivial tweaks like using primitives instead
of boxed numbers; you real get speed by changing the algorithm to
something fast - and, in clojure, something that will leverage
multi-core hardware.

         <mike
-- 
Mike Meyer <m...@mired.org>             http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

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