Hi,

In message "Re: map taking an argument (was: Re: join_with)"
    on Thu, 14 Dec 2006 01:58:15 +0900, dblack / wobblini.net writes:

|There was an RCR a while back, rejected by Matz, that asked for:
|
|   enum.map(:m)
|
|to be the same as:
|
|   enum.map {|e| e.m }
|
|It looks like Ruby >= 1.9 has this:
|
|   enum.map(&:m)
|
|which strikes me as the same thing, functionally, but visually noisier
|and semantically more obscure.
|
|I'm just wondering what the rationale is for rejecting the simple
|version and introducing the less simple one.

(a) noisier form works not only for map, but also for every method
    that take a block.

(b) if we wanted to add same functionality for every iterator method,
    we have to modify them all.  besides that, some iterator methods
    already take arguments that make less noisy form difficult.

(c) ampersand would serve as visual clue, which tells you that symbol
    works as some kind of block.  it is difficult to tell what :m
    means in less noisy form.  that could be a method name that map
    based on instead of each, or some other thing.

Choose whichever you want.

							matz.