home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!decwrl!pa.dec.com!src.dec.com!bates@salm04.boeing.com
- From: bates@salm04.boeing.com
- Newsgroups: comp.lang.modula3
- Subject: Language definition ambiguity
- Message-ID: <9207311334.AA10485@atc.boeing.com>
- Date: 31 Jul 92 13:34:08 GMT
- Lines: 36
- To: "m3@src.dec.com"@BCSAIC.pa.dec.com
-
- I am reading the latest M3 language definition in the August SIGPLAN.
- Section 3.2 says:
-
- "For a VAR parameter, the actual must be a writable designator
- whose type is the same as that of the formal, or, in case of
- a VAR array parameter, assignable to that of the formal."
-
- I first parsed this to mean:
-
- "in case of a VAR array parameter, the actual's type must be
- assignable to the type of the formal."
-
- Looking at the definitions of assignability of types to types,
- of subtypes, and specializing to arrays, this would allow an
- open array actual to be passed to a fixed array formal without
- a shape check, which isn't safe. So, a reread gave me this
- alternate interpretation:
-
- "in case of a VAR array parameter, the actual must be
- assignable to the type of the formal."
-
- This invokes assignability of an expression to a type, which
- includes the shape check. I presume this is the right
- interpretation.
-
- I think the English is ambiguous, or possibly even misleading,
- since we don't know if the implied parallel text before
- "assignable" is "a writable designator whose type is" or
- "a writable designator .. (which) is"
-
- Rodney M. Bates
- Boeing
- P.O. Box 7730, MS K80-13
- Wichita, KS 67277-7730
- 316-523-2015
- bates@awsil4.boeing.com
-