From: "Berger, Daniel" Date: 2003-12-06T01:04:15+09:00 Subject: Re: Dumb question to which I ought to know the answer by now > -----Original Message----- > From: Mark J. Reed [mailto:markjreed@mail.com] > Sent: Friday, December 05, 2003 8:47 AM > To: ruby-talk@ruby-lang.org > Subject: Re: Dumb question to which I ought to know the answer by now > > > On Fri, Dec 05, 2003 at 11:32:51PM +0900, > nobu.nokada@softhome.net wrote: > > Once I'd proposed similar; > > > > hash[*keys] = *values > > > > That would be handy, but I don't think it's possible to > define such a method in current Ruby. See "hashslice" by Michael Granger, available on the RAA. require "hashslice" h = {} keys = %w/one two three/ vals = %w/ruby perl python/ h[*keys] = *vals h["one"] -> 'ruby' h["two"] -> 'perl' h["three"] -> 'python' :=) Regards, Dan