On Sat, 29 Oct 2005 17:52:05 +0200, Trans <transfire / gmail.com> wrote:

>
> Brian Schröäer wrote:
>> If you are so bold, I have to chime in again to say that
>>
>>   ary.sort_by :meth
>>
>> reads a lot better than
>>
>>   ary.sort_by.meth
>>
>> because we don't do method chaining here.
>>
>> Sorry, could not resist. ;-)
>
> Ahhhhh... but can you do:
>
>    ary.sort_by.meth(foo, bar, wack!)

So, what we really need is the implicit block variable, because it can do  
all that ;-)

ary.sort_by { it.meth }

ary.sort_by { it.meth(foo, bar, wack!) }

and even:

ary.sort_by { some_hash[it] }


Dominik