From: Adam Prescott Date: 2011-06-07T20:26:32+09:00 Subject: Re: CORE - Altering Behaviour of "each do" (default param "item") --20cf303f695cdc300d04a51d7d9b Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 2011/6/7 J=C3=B6rg W Mittag > Ilias Lazaridis wrote: > > I've just noticed repetitions within code like that: > > > > names.each { |name| puts name} # 3 times "name(s)" > > That's because nobody who knows even the tiniest bit of Ruby would > ever write it like that. > > names.each(&method(:puts)) > > Would probably be the most idiomatic way. > That's a fairly sweeping statement. I know more than the tiniest bit of Rub= y and I prefer { |name| puts name } to &method(:puts). More than prefer, in fact, I would never use the latter. --20cf303f695cdc300d04a51d7d9b--