Russell Whitaker wrote:
The capacity, OTOH, is initialized, and must be in order for the string to work at all.
Would it be reasonable to define the length to be 0 as the default initialization?
It would be nonstandard. Basically the same question as defining default values for other types. The programmer can do this explicitly (String (n) value '') if wanted.
Otherwise the following should produce an error but dosen't:
program foo; var s : string( 500 ); begin writeln( length(s) ); end.
As I said, GPC doesn't check for using undefined values at all. (Currently, and this isn't going to change soon, as this is not exactly trivial to implement in general ...)
Frank