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
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.