On Jul 4, 2005, at 3:22 PM, Garance A Drosehn wrote:

> there is one thing about the example on page 25 (of the pdf)
> which concerns me a little bit.  The example has:
>
> class MyTest
>   def factorial(n)
>     f = 1
>     n.downto(2) { |x| f *= x }
>     return f
>   end
> end
>
> turn into:
>
> static VALUE factorial(VALUE self,
>                         VALUE _n) {
>     long n = NUM2INT(_n);
>     long f;
>     long x;
>     f = 1;
>     x = n;
>     while (x >= 2) {
>         f = f * x;
>         x = x - 1;
>     };
>     return INT2NUM(f);
> }
>
> [cut]

I'm afraid that in your "concern" you missed the whole point of that  
demonstration, which is:

                 OOOOO SHINY!

--
ryand-ruby / zenspider.com - Seattle.rb - http://www.zenspider.com/ 
seattle.rb
http://blog.zenspider.com/ - http://rubyforge.org/projects/ruby2c