joda at interaccess.com
Wed Sep 22 00:12:39 UTC 1999
agree at carltonfields.com wrote:
> >I am simply talking about > creating the
> > most general string implementation possible.
> We already have the most general string implementation possible. It's called Array, and its very, very fast and well-implemented. What is it that makes a String different from an Array? Let's define the protocol and a class hierarchy, and see where we should be going, if anywhere.
> > Using a "generic object oriented > character based
> > string class" is the most general string object design > possible and has
> > many benefits.
> Once again, how is it different from Class array? What do we need to add to make it happen?
> At the end of the day, I don't think anyone is really disagreeing with Peter on the points to which he has addressed himself. There is no reason one can't go ahead and define or code these protocols -- it just hasn't been done yet. Once we see what it needs to do, and only then, we can meaningfully analyze its merits and weaknesses, if any.
Hmmm... I tend to agree that the root of the problem is that we lack a good
abstract definition of String, and I wonder if we really can have one that's
much more specific than ArrayOfCharacter. Besides the obvious comparisons,
concatenation and substring operations, things we often like to do with strings
in various languages are pattern matching with regular expressions,
token streams, storing them in files, reading them from files,
as a statement in some human or computer language ... But most of those operations
might properly be done on objects that Strings are convertible
Do we really want a regular expression capability for GeneralString? --
maybe so --
certainly Perl's implementation of regular expression functions on
is a major advantage over many other languages. I suppose one might
GeneralString>>asRegularExpression (the compiler) and
GeneralString>>match: aRegularExpression (the interpreter),
hypothesizing a RegularExpression
class -- which would have to be pretty tricky with GeneralCharacter s...
More information about the Squeak-dev