Logan Capaldo wrote: > On 5/3/05, Joel VanderWerf <vjoel / path.berkeley.edu> wrote: > > >>class Array >> def hashmap >> h={} >> each {|x| h[x] = yield x} >> h >> end >>end >> >>[1,2,3].hashmap {|x| x*10} >># => {1=>10, 2=>20, 3=>30} >> >> > > > Wouldn't it make more sense to put #hashmap in module Enumerable? > Just a thought. Of course. It would also probably make sense to choose a better name. #map_to_hash, maybe?.