From: "David A. Black" Date: 2005-10-30T03:15:09+09:00 Subject: Re: "Readability" inflation --8323328-789305799-1130609703=:27369 Content-Type: MULTIPART/MIXED; BOUNDARY="8323328-789305799-1130609703=:27369" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323328-789305799-1130609703=:27369 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Hi -- On Sun, 30 Oct 2005, Brian Schr=F6der wrote: > On 29/10/05, Dominik Bathon wrote: >> On Sat, 29 Oct 2005 17:52:05 +0200, Trans wrote: >> >>> >>> Brian Schr=F6der 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 d= o >> all that ;-) >> >> ary.sort_by { it.meth } >> >> ary.sort_by { it.meth(foo, bar, wack!) } >> >> and even: >> >> ary.sort_by { some_hash[it] } >> >> >> Dominik >> > > What is so bad about > > ary.sort_by { | it | it.meth(foo, bar, wack!) } > > Then you can even make your sourcecode readable by putting information > into the it > > playlist.sort_by { | track | track.meth(foo, bar, wack!) } > instead of > playlist.sort_by { it.meth(foo, bar, wack!) } > > where it is unclear what the it is. I agree; I think a loop/block variable with a real name is a step forward from one without one. And yes, you could do: track =3D it but I'd rather not have the problem to solve in the first place. I think it's been solved already by Matz :-) David --=20 David A. Black dblack@wobblini.net --8323328-789305799-1130609703=:27369-- --8323328-789305799-1130609703=:27369--