From: Tom Sawyer Date: 2002-07-08T10:05:08+09:00 Subject: Re: String#each do you think its just over the top to change how .each works ? or is that just too much code breakage? also, how is support for strings going to change in the future with the adaptation of i17m (i18n?) support. ~transami On Sun, 2002-07-07 at 17:04, Hal E. Fulton wrote: > Well, let's come full circle and get back > to "each" (which started the discussion). > > The rationale for the current behavior (and > someone else could explain this better) is > that the "elements" of which a string is > composed are subject to debate. In some > situations, a string could be considered a > sequence of lines. > > There are each_byte and each_line iterators, > in fact. So what should 'each' do? One or > the other. Matz picked iteration by line. > It's just the default. > > If you specifically want bytes or lines, > you can use the specific iterator. > > Yes, it was a surprise to me, too. But I > have gotten used to it and I accept it. > > If Matz changes it, I will accept that > and get used to that, too. He is good at > what he does. > > A related topic: > > I don't know much about m17n or i18n... but > I was wondering if an each_char iterator > might be a good idea for the future? That > way we could distinguish between bytes and > characters. > > I favor making software as language-flexible > as possible, but I'd hate to see it slow > things down or complicate the API too much. > > But I'm wandering outside my realm of knowledge. > > Hal Fulton > > > > -- ~transami "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -- Benjamin Franklin