From: Dennis Newbold Date: 2002-04-06T03:51:37+09:00 Subject: Re: Question abt. Operation of Iterators On Fri, 5 Apr 2002, Yohanes Santoso wrote: > > Both Array and String fall under the mathematical list category, not > mathematical set. So, their iterators travel in a definite order. In > the case of #each, the traversal is from the first subcomponent to > the last in that order. That is why there is #reverse on both Array > and String. > > YS. > Cool. Thanks for the quick feedback. It appears from the documentation I've been able to find, that the Array class has a very useful reverse_each iterator, but that the String class only has a reverse operator. Since Ruby, overall, seems to be very committed to providing a very rich polymorphic set of methods applicable to a wide range of objects (e.g., most everything has a to_s method), it makes me wonder -- do you know why reverse_each was implemented only for Arrays and not for Strings? Any plans to add a reverse_each iterator for strings in a subsequent Ruby release? Thanks again. Dennis