Hi,

1.
why doesn't the second block work?

------------snip-------------

lines = [["item0-0","item1-0","item2-0"],["item0-1","item1-1","item2-1"]]

------------snip-------------

# works:
lines.each_index {|lines_index|
   line = lines[lines_index]
   line = line.each_index {|line_index|
     line[line_index] = '<td>' + line[line_index] + '</td>'
   }
}

------------snip-------------

# doesn't:
lines.each_index {|lines_index|
   line = lines[lines_index]
   line = line.each_index {|line_index|
     item = line[line_index]
     item = '<td>' + item + '</td>'
   }
}

------------snip-------------

print lines.inspect

2.
wouldn't it be nice to be able to just say:

Array#replace_each:
-----
an_array = ['one', 'two']

an_array.replace_each do |item|
  'number ' + item
end
-----
-> ['number one', 'number two']

Or did I overlook an equivalent?


Tobi
-- 
Tobias Reif
http://www.pinkjuice.com/myDigitalProfile.xhtml

go_to('www.ruby-lang.org').get(ruby).play.create.have_fun
http://www.pinkjuice.com/ruby/