Ah -- well that makes sense then.  Bravo!

Rob

On Jun 17, 2:15 pm, Rich Hickey <richhic...@gmail.com> wrote:
> On Jun 17, 5:10 pm, Rob Lachlan <robertlach...@gmail.com> wrote:
>
> > I think the enhanced support for primitives is fantastic.  I'm looking
> > forward to doing more numerical work in clojure.
>
> > Quibble:  Using a multiple-recursive algorithm for calculating
> > fibonnaci values.
>
> > user> (defn fib-2 [n] (if (>= n 1)
> >                   (loop [i 0 f0 0 f1 1]
> >                     (if (== i n) f0 (recur (inc i)
> >                                            f1
> >                                            (+ f0 f1))))))
>
> Naive fib is often used as a benchmark, the point being not to do a
> fast fib, but comparative, 'what is the perf on naive fib'? Not being
> tail-recursive, it tests function calling overhead, and thus here
> demonstrates what we gain by not having to box on args and returns.
>
> Rich

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