From: "David A. Black" Date: 2005-07-20T20:48:34+09:00 Subject: Re: Trying to alias for/foreach Hi -- On Wed, 20 Jul 2005, Leslie Viljoen wrote: > Hello > > I am new to Ruby, but enjoying it incredibly. I'd like to ask some advice: > I noticed that IO has a "foreach" iterator while Array's, etc. mostly call > their per-item iterators "each". I thought I could get rid of this > inconsistency like this: There's no inconsistency. "each" is a message you send to objects that have a collection or series of elements to iterate through. An Array instance is such an object. But IO is a Class object, and has nothing that "each" would make sense for. An IO.each class method would thus be out of sync and inconsistent with how "each" is used elsewhere in Ruby. David -- David A. Black dblack@wobblini.net