From: dblack@... Date: 2003-07-21T05:15:57+09:00 Subject: Re: Proposal: Array#to_h, to simplify hash generation Hi -- On Mon, 21 Jul 2003, Martin DeMello wrote: > Yukihiro Matsumoto wrote: > > In message "Re: Proposal: Array#to_h, to simplify hash generation" > > on 03/07/20, Martin DeMello writes: > > | > > |And we already have Array methods that assume an associative array. > > > > I think you mean assoc and rassoc. But they are look-up methods. No > > harm would happen for non assoc input for them. I feel like Hash > > creation is little bit different. > > Actually, I've always felt those were out of place in Array too. And if > they were factored out into an AssocArray mixin, we could conveniently > put hashify there. 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. David -- David Alan Black home: dblack@superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav