From: Markus Date: 2004-10-25T23:44:05+09:00 Subject: Re: [rcr] String#first / String#last On Mon, 2004-10-25 at 07:25, trans. (T. Onoma) wrote: > On Monday 25 October 2004 09:49 am, Robert Klemme wrote: > | Yeah possibly. Another problem with each_byte is that byte != char for > | many encodings. But AFAIK #each_byte and #split(//) share this problem. > | > | I believe a drawback of using "foo".split(//) is that it's less > | performant: you need to create the tmp array plus all the string instances > | (although they share the buffer AFAIK). > > I think this is a very interesting point. I wonder how Ruby 2 will progress in > the area. Isn't i18N (not that I really know what that entails) on the map? > How does that effect things. Is it then prudent to create an actual Character > class, such that a String is essentially an Array of Characters? (not to say > there won't be differences between Array and String, but in essence) I would like that. Characters are an interesting class in there own right--and they are _not_ bytes. Strings are much more like arrays of Characters than Characters are like Integers, so that would be a much cleaner way to go. *smile* We could also resolve the discrepancies by deprecating strings in favor of Bignums, which I suspect Kurt Gæ—¦del would like, if no one else. -- Markus