Gary Wright wrote:
> Perhaps #map and #collect should stay as they are and there should be a 
> new method defined for Array, Set, and Hash that returns an instance of 
> the collection instead of an instance of Array.  Changing the definition 
> of Set#map and Hash#map would most likely break existing code.

[1, 2, 3].map_as(Set) {|i| i+1}

[1, 2, 3].map_into(Set.new) {|i| i+1}

Probably ugly to implement, since the Enumerable interface doesn't 
support insertions, and so there would likely be a big switch().

-- 
       vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407