On 18/06/06, david <[EMAIL PROTECTED]> wrote:
irb(main):042:0> y
=> [88.0, 99.0, 1.0, 3.0]
irb(main):039:0> y.length.times do puts "blah" end
blah
blah
blah
blah
=> 4
irb(main):040:0> y.length-1.times do puts "blah" end
blah
=> 3
I expected the last command to print "blah" 3 times.
Try:
(y.length-1).times do puts "blah" end
The '.' is binding more tightly than the '-'.
daniel.
_______________________________________________
coders mailing list
[email protected]
http://lists.slug.org.au/listinfo/coders