From: OZAWA Sakuro Date: 2000-03-23T12:25:33+09:00 Subject: [ruby-talk:02097] Re: Array Gotchas In article <200003230244.LAA07577@hanare00.math.sci.hokudai.ac.jp>, GOTO Kentaro writes: > >Ruby> ary = [1, 2, 3, 4, 5] > >Ruby> ary.each_index {|i| print i, "\n"} > Generally speaking, A statement returns a value in Ruby. > Each last output line is the value of the statement, i.e., In addition, bcause array indice have range from 0 to size-1, ary.each_index {|i| print i, "\n"} will print values from 0 to (ary.size - 1). ^^^^^^^^^^^^^^ While (0..ary.size).each {|i| print i, "\n"} will print values from 0 to ary.size. -- OZAWA -Crouton- Sakuro PGP Fingerprint: C98F 74E0 AEEB 4578 1DFC F650 3BE0 9627 11FC C9F5