Martin,
Thanks.
>> But, it does not appear possible, from within StringProc
>> to call another similar processing routine, StringSubProc(instring).
> No, this is perfectly legal, because parameter compatibility is
> different
> from assignment compatibility (see statement (c) in the static semantics
> of clause 6.9.3.1).
Some more study of the ISO do***ent does make it clear to me.
Indeed the parameter compatibility rule for formal open array
parameters (which are not literal strings)
does boil down to "is-array-type()" and
"is-value-parameter-compatible-component-compatible()".
I did not realize at first that open arrays satisfy is-array-typ().
Mostly I can guess at the VDM-SL, but I better work harder to understand
the embedded subtleties.
> PrintArray(ConstArray);
> PrintArray(VarArray);
> PrintArray("Hello");
The English notes are helpful, but maybe not always as useful. I have been
fixated on this note:
"A string literal is not equivalent to a concrete string constant
constructed with an array
constructor. For example, values of the string literal type cannot be
indexed, concrete string
constants cannot be concatenated using the catenation symbol, and the
compatibility
rules for string literals are more relaxed than those for concrete string
constants."
But it appears only that a statement somewhat similar to yours
PrintArray(ConstArray+"Goodbye");
would be invalid, and that not because of the open array rules.
Now I will work on getting my compiler to be correct!
Tom


|