From: Martin DeMello Date: 2003-07-21T14:39:25+09:00 Subject: Re: Proposal: Array#to_h, to simplify hash generation dblack@superlink.net wrote: > > But the special case of converting an associative array to a hash is > different from the "classic" (in terms of volume of ruby-talk devoted > to it, and how long we've been discussing it :-) array-to-hash > conversion, as per RCR #12 and its definition of "hashify" (a term I > proposed reluctantly, knowing people would hate it :-) but it seemed > the most accurate for what I was describing). Modularization is a > good idea, though, particularly for the various home-grown > [{to_(h}ash]ify) variants in circulation, though organizing that kind > of thing community-wide is something I've never figured out how to do. To me, 'hashify' implies taking an assoc array and converting it to hash form (or perhaps the perl-influenced [a, b, c, d] -> {a=>b, c=>d}). I still can't think of a name for the useful case :) make_hash, perhaps .. *(1..10).make_hash {|i| f(i)} or maybe the complementary hash_to and hash_from, where the block is respectively the value and the key for the corresponding array entry :) martin