Modifying string length?_(re)

Tue, 29 Apr 1997 12:53:53 +0200



> I would say:  GPC *does* optimize this.  Just type `gpc -O -S foo.pas'
> and look at `foo.s' ...

Fine! I'll take a look at it.

> It would not be too difficult to make "MyStr.length" and "MyStr.String" 
> accessible "record fields" of strings.  Would it be desireable?

Yes! (At least length; the String part is accessible anyway with s[n].)

>  I am
> not sure how this fits into the standard ...
 
I'm not, either. If it conflicts, it should be disabled with
"--extended-pascal", I suppose.

> Another thing *is* planned:  A new data type `ShortString' (or
> `ShortStr'?)  which will be the UCSD/Borland version of Strings.  In many
> contexts, they are better than Extended Pascal string schemata because
> they have only 1 byte overhead instead of 8.  (But this will be a lot
> of work.  Anybody interested to help here???)
 
What about another type with a 2 byte length field (2 instead of 8 bytes
overhead)? 255 chars max length are sometimes not enough. BTW: I heard
Delphi has some kind of long strings. Anyone knows what they are?

> > (Are you planning
> > to make strings regular schema types then -- regular except for the extended
> > syntax that allows s[n]?)
> 
> No.  They are exceptions in yet another way because they have the
> implicit read-only "length" field.
 
That's what I meant. If length was made accessible in a normal way, it
would not be an exception.
-- 
Frank Heckenbach, Erlangen, Germany
heckenb[No_Spam! Remove this to reply.]@mi.uni-erlangen.de
Turbo Pascal:   http://www.mi.uni-erlangen.de/~heckenb/programs.htm
Internet links: http://www.mi.uni-erlangen.de/~heckenb/links.htm


Frank Heckenbach (heckenb@mi.uni-erlangen.de)

HTML conversion by Lluís de Yzaguirre i Maura
Institut de Lingüística Aplicada - Universitat "Pompeu Fabra"
e-mail: de_yza@upf.es