From: Kenichi Komiya Date: 2001-02-16T02:56:36+09:00 Subject: [ruby-talk:10916] Re: Making Hash from two lists From: David Alan Black Subject: [ruby-talk:10915] Re: Making Hash from two lists Date: Fri, 16 Feb 2001 02:28:01 +0900 > > Q1: Do you think this is worth including to core Ruby? > > Yes. I tend to think in terms of Array#to_hash more than > Hash#from_array, but perhaps both (?). Beside the method naming, I choose to make it as Hash.map because: * It allows any Enuerable object for keys and vals. (Not the case for Array#to_hash) * I think it should be a Hash's class method rather than an instance method of Hash. Becausee it does not require existing Hash to operate. > > Q2: Do you think the name is confusing? If so what is good > > name for this method? > > See names above, which I think would be OK. I prefer something not specific to Array. > > > Q3: I belive there was a discussion to create a snipet > > repository, which archives useful but small code examples. > > Is this facility already online? > > I can only answer from one perspective, namely that of the Ruby > Garden, which is intended to be more of a workshop than a repository, > though possibly that too. The answer is that it isn't online yet. > However, I defer to others who may have repositories of various > kinds up and running. Thanks for suggegstion. I looked the www.rubygarden.com. I also think wiki style workshop is good for sharing code snipets. Regards, Kenichi Komiya