Changes between Version 2 and Version 3 of ShorterImportSyntax


Ignore:
Timestamp:
Sep 16, 2015 12:36:26 PM (4 years ago)
Author:
simonpj
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ShorterImportSyntax

    v2 v3  
    1212
    1313{{{
    14  import modid maybeImpspec maybeAs
     14import modid maybeImpspec maybeAs
    1515}}}
    1616
    17 Semantics are the same as existing imports unless both an `impspec` (i.e.
    18 a parenthesised list of identifiers optionally prefixed with the `hiding`
    19 keyword) and an `as` (e.g. `as M`) are present. In such a case, all  identifiers exported by `modid` are accessible behind the prefix given by  the `as`.
     17Semantics are the same as existing imports unless both an `impspec` (i.e. a parenthesised list of identifiers optionally prefixed with the `hiding` keyword) and an `as` (e.g. `as M`) are present. In such a case, all identifiers exported by `modid` are accessible behind the prefix given by the `as`.
     18
     19In the language spec,
     20
     21{{{
     22impdecl →       import [qualified] modid [as modid] [impspec]
     23}}}
     24
     25This grammar leaves out things like package imports and source imports, so I'm not sure if you want me to provide one grammar for all of them. For ShortImports, the grammar is,
     26{{{
     27impdecl -> import modid impspec as modid
     28}}}
    2029
    2130== Examples ==