From: Stefan Rusterholz Date: 2007-07-16T21:15:16+09:00 Subject: Re: clean nice way (hash) SonOfLilit wrote: >> > > a.each {|key,value| a[key] = {'name' => value}} >> > >> > Are you allowed to do this? >> >> Why not? Seem to work here. >> > > I was taught not to modify a structure I'm #each ing on... > > Does this not apply when you only modify substructures of it? > > > Aur I think that only applies for insert/delete. As e.g. with an array it may happen that elements are left out if you delete them wile iterating, or that you iterate over a newly create value (which you might not want to) Regards Stefan -- Posted via http://www.ruby-forum.com/.