From: Ilias Lazaridis Date: 2011-06-06T17:35:30+09:00 Subject: Re: CORE - Altering Behaviour of "each do" (default param "item") On 6 Éïýí, 01:11, Yukihiro Matsumoto wrote: > Hi, > > In message "Re: CORE - Altering Behaviour of "each do" (default param "item")" >     on Sat, 4 Jun 2011 20:50:25 +0900, Ilias Lazaridis writes: > > |#Question: How can I alter the behaviour of "each" in the following > |way: > |names.each do > |  print item         # "item" is used by default > |end > | > |Is this possible, without going to C-level? > > It's possible but you have to redefine the each method.   ok > That reminds me Groovy's it.   I don't know "Groovy", but I dislike the "it", as it cannot be spoken like "each item" or "each value". I've just noticed repetitions within code like that: names.each { |name| puts name} # 3 times "name(s)" names.each { puts item } names.each { puts e) # e = entry > Currently I have no plan to change the core like that. So this would be a low-priority issue? Would a thoroughly worked out patch be accepted? . -- http://lazaridis.com