From: "David A. Black" Date: 2004-12-08T22:43:34+09:00 Subject: Re: Idiom for creating hash from two arrays Hi -- On Wed, 8 Dec 2004, Glenn Parker wrote: > Jonathan Paisley wrote: >> On Wed, 08 Dec 2004 05:43:42 +0900, trans. (T. Onoma) wrote: >> >> >>> On Tuesday 07 December 2004 12:42 pm, Jonathan Paisley wrote: >>> | def Hash.from_pairs(keys,values) # or some better name >>> >>> zipnew ? >> >> >> Hash.zipnew ... I quite like the similarity to Hash.new, and the inclusion >> of the already familiar zip idea is also a good thing. > > Why does it need a new name? Instead, why not extend Hash.new to do this > when it is passed two arrays? It seems pretty natural to me, and I don't see > any conflict with existing usage. What if you wanted to set a default value for the hash? David -- David A. Black dblack@wobblini.net