Frank Heckenbach wrote:
CBFalconer wrote:
I look on the string facility as similar to the file facility in some respects. For files, some sort of automatic initialization is needed so that reset/rewrite can function, and so that the error of reading/writing to unopened files can be detected. For strings the 'capacity' has to be initialized, and I doubt it would be much trouble to zero the length field at the same time. Note that this is much different from initializing the entire string storage.
To drag the analogy, initializing the length of a string would be comparable to resetting a file variable to an empty (internal) file, which is not done.
But perhaps more important, initializing strings (which are not declared with an explicit initial value) would be non-standard, and encouraging programmers to rely on this leads no more non-portable code. I don't think you'd like this. ;-)
Well, I always felt apologetic that, in PascalP, files as components of other things, such as arrays of files, or a file component of a record, required the non-standard use of "fileinit(record.filecomponent)" before it would function normally.
I destroyed the article where Gale (I believe) explained the ISO10206 specification. That was a mistake, I should have kept it here. As I see it the problem is that an uninitialized length field will mean unpredictable action, that may or may not involve an error message.