Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Modula 2 > Re: ISO Open Ar...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 7 of 7 Topic 331 of 383
Post > Topic >>

Re: ISO Open Array Parameters

by "Tom Breeden" <tmb@[EMAIL PROTECTED] > Apr 16, 2007 at 12:29 PM

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
 




 7 Posts in Topic:
ISO Open Array Parameters
"Tom Breeden" &  2007-04-10 09:00:05 
Re: ISO Open Array Parameters
"Chris Burrows"  2007-04-10 23:29:51 
Re: ISO Open Array Parameters
Martin Whitaker <spamt  2007-04-10 20:33:25 
Re: ISO Open Array Parameters
Keith Hopper <asgard@[  2007-04-12 10:09:09 
Re: ISO Open Array Parameters
"Tom Breeden" &  2007-04-15 13:27:41 
Re: ISO Open Array Parameters
Martin Whitaker <spamt  2007-04-15 22:35:57 
Re: ISO Open Array Parameters
"Tom Breeden" &  2007-04-16 12:29:47 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Oct 12 16:08:06 CDT 2008.