On 2010-02-08, Sebastian Hungerecker <sepp2k / googlemail.com> wrote:
> On 09.02.2010 00:20, Seebs wrote:
>> I guess, to me, "foo"[1] should be an o.  If printing it yields a number,
>> instead of the letter o, something has gone wrong.

> We agree on that. I've always thought ruby should have a Char class, so 
> "foo" could
> behave basically like a collection of Char. At least as far as [] is 
> concerned.

That might work.

I think the reason you need a single-character-string now is that things
like UTF-8 may make it ambiguous what the next "character" is, and not all
characters are a single byte.

So there's really two *separate* semantic changes.

1.  Subscripting gives textual data rather than raw numbers.
2.  Sometimes that textual data isn't a single byte.

These are related, but not quite the same.  The issue, I think, is that the
first implies the second, because some encodings have single bytes which are
not a character, but rather, the preamble to a character.

-s
-- 
Copyright 2010, all wrongs reversed.  Peter Seebach / usenet-nospam / seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!