Changes between Version 2 and Version 3 of Language

Show
Ignore:
Timestamp:
06/24/09 07:52:04 (5 years ago)
Author:
benl (IP: 150.203.160.45)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Language

    v2 v3  
    11 
    22== Modules == 
     3Modules start with an optional module identifier, followed by a list of export and import declarations. Export declarations must come before import declarations.  
    34 
    4 Modules start with an optional module identifier, followed by a list of export and import declarations. Export declarations must come before import declarations. 
     5{{{ 
     6Module 
     7    ::= module  ModuleId  where  ModuleBody 
     8     |  ModuleBody  
     9}}} 
    510 
    6 [[br]] 
    7  
    8 module 
    9  = '''module''' moduleId '''where''' moduleBody [[br]] 
    10  | moduleBody 
    11 [[br]] 
     11{{{ 
     12ModuleBody 
     13    ::= {  exportDecl;*  importDecl;*  topDecl;+  } 
     14}}} 
    1215 
    1316 
    14 moduleBody 
    15  = '''{''' {exportDecl;}*  {importDecl;}*  {topDecl;}+ '''}''' 
    16 [[br]] 
     17=== Exports === 
     18When there is an explicit export list, only those identifiers mentioned are exported from the module. If there is no export list then all identifiers are implicitly exported. 
     19 
     20{{{ 
     21ExportDecl 
     22    ::= export Var 
     23     |  export type Con 
     24}}} 
    1725 
    1826 
    19 exportDecl 
    20  = '''export''' var [[br]] 
    21  | '''export''' '''type''' con 
    22 [[br]] 
     27=== Imports === 
     28Foreign imports define the type of an external symbol. 
     29 
     30{{{ 
     31ImportDecl 
     32  ::=  import <moduleId>  
     33   |   import { <moduleId>;+ }  
     34   |   foreign import "<string>" <var> :: Type 
     35}}} 
    2336 
    2437 
    25 importDecl 
    26  = '''import''' moduleId [[br]] 
    27  | '''import {''' {moduleId}+ '''}'''