(Hopefully) final version of string refactoring

Howard Stearns hstearns at wisc.edu
Wed Apr 13 14:17:24 UTC 2005


[Walking in late...]

Skip the history. What are the semantics that you want?

For example, suppose String represents any collection of (e.g., 
Unicode?) Characters, and that for efficiency or foreign function 
interface, there are also some specialized Strings that are restricted 
in what code points they can handle. These specialized classes might be 
ASCIIString, or NullTerminatedCharString, etc.

[Coming in late, I don't know what is actually present in the new code. 
I might be guessing wrong.]

There is often a tendency for people to resist "renaming" something 
that was implemented in a specific way. But don't think about the 
implementation, think about the semantics. We should be free to change 
the implementation out from under people. The semantics should rarely 
change.

[I was brought up to believe that these specialized classes would be 
subclasses of String, but I'm vaguely aware that this might not be 
important in Squeak. In fact, if it's important for some implementation 
reasons that they NOT be, then String could be abstract, with concrete 
subclasses NullTerminatedCharString and UnicodeString.  I don't think 
this changes my point.  Now, if this is the case, and it turns out that 
the concrete subclass you want for the general case is to be defined as 
being "wide" but not necessarily Unicode, then I think you're all 
nuts...]

-H




More information about the Squeak-dev mailing list