From: Eric Mahurin Date: 2005-10-31T06:33:47+09:00 Subject: characters (and small strings) in ruby 2.0 ------=_Part_12259_27748226.1130708024647 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline In ruby 2.0, the current plan is to for a character to be represented as a String instead of an Integer. I'm writing a parser/lexer and I think not representing characters as immediate objects could be a significant performance penalty. Could I suggest something? How about a character be represented as frozen/immutable string and give very small (maybe up to 3 8-bit chars for 32-bit and 7 8-bit chars for 64-bit) immutable/frozen strings an immediate class (like a small Integer is a Fixnum)? So for most character encodings any character could be an immediate, but when necessary a normal String-like (frozen or immutable) object is used to encode the character (like Bignum's are used when you go over the Fixnum limit). ------=_Part_12259_27748226.1130708024647--