home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / modula3 / 861 < prev    next >
Encoding:
Internet Message Format  |  1992-07-31  |  1.5 KB

  1. Path: sparky!uunet!olivea!decwrl!pa.dec.com!src.dec.com!bates@salm04.boeing.com
  2. From: bates@salm04.boeing.com
  3. Newsgroups: comp.lang.modula3
  4. Subject: Language definition ambiguity
  5. Message-ID: <9207311334.AA10485@atc.boeing.com>
  6. Date: 31 Jul 92 13:34:08 GMT
  7. Lines: 36
  8. To: "m3@src.dec.com"@BCSAIC.pa.dec.com
  9.  
  10. I am reading the latest M3 language definition in the August SIGPLAN.
  11. Section 3.2 says:
  12.  
  13. "For a VAR parameter, the actual must be a writable designator 
  14.  whose type is the same as that of the formal, or, in case of
  15.  a VAR array parameter, assignable to that of the formal."
  16.  
  17. I first parsed this to mean:
  18.  
  19. "in case of a VAR array parameter, the actual's type must be
  20.  assignable to the type of the formal."
  21.  
  22. Looking at the definitions of assignability of types to types,
  23. of subtypes, and specializing to arrays, this would allow an
  24. open array actual to be passed to a fixed array formal without
  25. a shape check, which isn't safe.  So, a reread gave me this 
  26. alternate interpretation:
  27.  
  28. "in case of a VAR array parameter, the actual must be
  29.  assignable to the type of the formal."
  30.  
  31. This invokes assignability of an expression to a type, which 
  32. includes the shape check.  I presume this is the right
  33. interpretation.  
  34.  
  35. I think the English is ambiguous, or possibly even misleading,
  36. since we don't know if the implied parallel text before 
  37. "assignable" is "a writable designator whose type is" or 
  38. "a writable designator .. (which) is"
  39.  
  40. Rodney M. Bates
  41. Boeing
  42. P.O. Box 7730, MS K80-13
  43. Wichita, KS 67277-7730
  44. 316-523-2015
  45. bates@awsil4.boeing.com
  46.