>   How about removing the `where' from `module...where' and
>   `interface...where'   ...
>
> The reason we used the "module...where" convention is to allow for
> multiple modules to be included in one "file".  Your proposal is
> workable, but requires saying something extra about what terminates
> a module.  I agree, however, that having to write "where" all the
> time is a pain (I still forget to put it in sometimes!), so perhaps
> you could complete the proposal with the wording required to say when
> a module ends.

I suggest:

*) remove the paragraph about top-level indenting from 1.5
*) change 5.2:

   script  ->  module1 module2 ...       (n>=1)
   module  ->  { [header ; body] [;] } | { header[;] } | { body[;] }
   header  ->  { [moddecl ; impfix] [;] } | { moddecl[;] } | { impfix[;] }
   impfix  ->  { [impdecls ; fixdecls] [;]} | { impdecls[;] } | { fixdecls[;] }
   moddecl ->  `module' modid [exports]
   body    ->  topdecls

   NB The form { ... [[fixdecls ;] topdecls [;]] } in the current syntax is
   inconsistent in disallowing {;} which other blocks in the syntax allow.

*) change the text of 5.2 to correspond, and in particular change the second
   paragraph to:

   If the first lexeme in a module is not a {, then the layout rule applies
   for the top level of the module.  Several modules may appear in one script.
   Each module ends when the `module' keyword of the next is encountered.  An
   abbreviated form of module is permitted, which omits the moddecl.  If this
   is used, the moddecl is assumed to be `module Main'.  An abbreviated module
   may not appear in the same script as some unabbreviated modules.

   NB The first paragraph of 5.2 *already* uses the term body for the topdecls
   alone, in contradiction to the current syntax.

*) do the same for interfaces in 5.3 (we don't want modules and interfaces in
   the same file, do we?) and change B.4, B.5, B.6 to match.

Ian

Reply via email to