alice
manual.
the
language
________ Overview ____________________________________________________
Alice ML is based on the
Standard ML
programming language (SML), as defined in
However, Alice ML features several major extensions relative to SML:
You should also be aware of some
________ Syntax summary ______________________________________________
Alice defines some additional identifiers as reserved words:
any assert assertd constructor exttype fct from
import non lazy pack spawn unpack
withfun withval _file_ _line_
The following grammar collects all syntactic extensions of Alice ML
relative to Standard ML. Derived forms are marked (*).
dec |
::= |
... |
1) |
| |
exttype extbind |
extensible datatype |
| |
constructor econbind |
generative constructor |
fvalbind |
::= |
<lazy | spawn> |
lazy/concurrent function
(m,n≥1) (*) |
| |
<op> vid atpat11 ... atpat1n <: ty1>
= exp1 |
| |
|
<op> vid atpat21 ... atpat2n <: ty2>
= exp2 |
| |
| ... |
| |
|
<op> vid atpatm1 ... atpatmn <: tym>
= expm |
| |
<and fvalbind> |
extbind |
::= |
tyvarseq tycon |
extensible datatype |
econbind |
::= |
<op> vid <of ty>
: tyvarseq longtycon
<and econbind> |
new constructor |
| |
<op> vid
= <op> longvid
<and econbind> |
synonym |
strbind |
::= |
... |
|
| |
_ <: sigexp> = strexp
<and strbind> |
anonymous structure (*) |
funbind |
::= |
strid strpat1 ... strpatn
= strexp
<and funbind> |
functor binding (n≥1) (*) |
1) The extended phrase class dec contains all of Standard
ML's dec, strdec and topdec.
1) See the module syntax
summary for a more precise grammar of structure expressions and functor
application.
component |
::= |
ann <program> |
component |
ann |
::= |
import imp from string |
import announcement |
| |
import string |
import all (*) |
| |
|
empty |
| |
ann <;> ann |
|
imp |
::= |
val valitem |
|
| |
type typitem |
|
| |
datatype datitem |
|
| |
exttype extitem |
|
| |
constructor econitem |
|
| |
exception exitem |
(*) |
| |
structure stritem |
|
| |
functor funitem |
(*) |
| |
signature sigitem |
|
| |
infix <d> vid1
... vidn |
(n≥1) |
| |
infixr <d> vid1
... vidn |
(n≥1) |
| |
nonfix vid1
... vidn |
(n≥1) |
| |
|
empty |
| |
imp <;> imp |
|
valitem |
::= |
<op> vid
<and valitem> |
|
| |
<op> vid : ty
<and valitem> |
|
typitem |
::= |
tycon <and typitem> |
|
| |
tyvarseq tycon
<and typitem> |
|
datitem |
::= |
tycon <and datitem> |
|
| |
tyvarseq tycon = conitem
<and datitem> |
|
conitem |
::= |
<op> vid <of ty>
<| conitem> |
|
extitem |
::= |
tycon <and extitem> |
|
| |
tyvarseq tycon
<and extitem> |
|
econitem |
::= |
<op> vid
<and econitem> |
|
exitem |
::= |
<op> vid
<and exitem> |
(*) |
| |
<op> vid of ty
<and exitem> |
(*) |
stritem |
::= |
strid <and stritem> |
|
| |
strid : sigexp
<and stritem> |
|
funitem |
::= |
strid <and funitem> |
(*) |
| |
strid strpat1 ... strpatn
: sigexp
<and funitem> |
(n≥1) (*) |
sigitem |
::= |
sigid <and sigitem> |
|
last modified 2004/04/13 11:29