Does these constructs provide the current index value somehow?
Regards,
Manish


On Wednesday 19 July 2006 21:50, Paul Carvalho wrote:
> Ruby rocks!  My fav is:
>
>   9.times {|x| puts x}
>
> It doesn't get any clearer for me than just telling it how many times I
> want it to loop without worrying about extra syntax that I'm likely to get
> wrong.. ;)
>
> On 19/07/06, Chris McMahon <[EMAIL PROTECTED]> wrote:
> > On 7/19/06, mi <[EMAIL PROTECTED]> wrote:
> > > ahhhhhhhhhhh, That was it!!!  I'm just NOT used to start an iteration
> > > form 0:-(  THANKS a million!!!!!!!!
> >
> > Ruby folks don't generally use for loops:
> >
> >
> > 1.upto 9 do |x|
> >   puts x
> >   end
> >
> > ruby loop.rb
> > 1
> > 2
> > 3
> > 4
> > 5
> > 6
> > 7
> > 8
> > 9
> >
> > >Exit code: 0
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to