On Jun 2, 2008, at 7:13 PM, David A. Black wrote:

> 'm just wondering whether it would make more sense for Set to have a
> #map method that returned a set, rather than an array, as long as that
> behavior is considered meaningful (as it appears to be since that's
> how Set#map! is working). Otherwise that aspect of the map/map!
> distinction seems kind of arbitrary.

it doesn't seem arbitrary:

cfp:~ > ruby19 -r set -e' p Set.instance_methods(false).grep(/map/) '
[:map!]

set gains #map from Enumerable.  if map did not return array it would  
remove the ability to rely on interface polymorphism in ruby methods  
accepting enumerables - which is something most of us take for granted  
by now.  to me it seems more strange that 'map!' returns a set -  
rather than a 'changed' status - but not overly so as i expect to have  
to use bang methods carefully after reading the docs...

cheers.

a @ http://codeforpeople.com/
--
we can deny everything, except that we have the possibility of being  
better. simply reflect on that.
h.h. the 14th dalai lama