$ ruby -v
ruby 1.4.3 (1999-12-08) [i586-linux]
$ruby sample/irb.rb
irb(main):001:0> ary = Array.new(3,5)
[5, 5, 5]
irb(main):002:0> ary[0..2] = 7
7
irb(main):003:0> ary
[7]
irb(main):004:0> ary[0]
7
irb(main):005:0> ary[1]
nil
irb(main):006:0>

According to the Ruby manual:
self[start..end] = val
Replace the items from start to end with val. If val is not an array,
the type will be converted into the Array using to_a method.

But my exercise above did not do that. Why?

Dat
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com