Multilingual Support - What is a String now?
Last updated at 11:07 am UTC on 6 December 2015
A String is an indexed collection of Characters (Squeak 5.0).
Multilingual Support - General String as ArrayedCollection
From: "Jarvis, Robert P."
Subject: Unicode support
Date: Wed, 22 Sep 1999 08:11:33 -0400
It seems that what's being attempted here is to create a monster String class which can do anything. I don't think that's what String is intended to be.
Let's review the class comment for String:
A String is an indexed collection of Characters, compactly encoded
as 8-bit bytes.
String support a vast array of useful methods, which can best be learned by browsing and trying out examples as you find them in the code.
Here are a few useful methods to look at...
String also inherits many useful methods from its hierarchy, such as
- SequenceableCollection ,
- SequenceableCollection copyReplaceAll:with:
String is not intended to be a collection of DNA base pairs(DnaSequence?), or a collection of musical notes (Score?), or a collection of other arbitrary objects (OrderedCollection? Array? Dictionary?). If you need a collection of DNA base pairs with specific new behavior, bite the bullet and subclass the appropriate Collection class, add your specific behavior, and move on. Ditto for musical notes. Arguably ditto for collections of Unicode/hieroglyphic/whatever characters. Just my opinion.