From: Gregory Seidman Date: 2008-06-05T11:18:51+09:00 Subject: Re: double assignation in a hash On Thu, Jun 05, 2008 at 08:23:53AM +0900, nico Itkin wrote: > hi ! > > I'm new to ruby, i'd like to know if it is possible to make the > following kind of assignation in a hash, like i used to do in php : > > a={} > a[:b][:c]="value" > > the goal for me is to create a hash by iterating on keys, like > > hash={} > [a,b,c].each do |k1| > [d,e,f].each do |k2| > hash[k1][k2] = afunction(k1,k2) > end > end > > this last code lead to a nil.[] error > > Could you help me ? . You may find this of interest: http://redcorundum.blogspot.com/2007/05/just-nifty-meta-meta-tidbit.html --Greg