Ranges


(Marcin 'Qrczak' Kowalczyk) #1

Tue, 11 Jun 2002 01:02:03 +0900, Peter Hickman peter@semantico.com pisze:

Is there a particular reason why

(10…1).each {|n| puts n}

doesn’t do the reverse of

(1…10).each {|n| puts n}

Yes: ‘(1…n).each {|n| puts n}’ should print n numbers, even if n == 0.

···


__("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
__/
^^
QRCZAK