mosmlref - Moscow ML Language Overview Version 2.00 of June...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Moscow ML Language Overview Version 2.00 of June 2000 Sergei Romanenko, Russian Academy of Sciences, Moscow, Russia Claudio Russo, Cambridge University, Cambridge, United Kingdom Peter Sestoft, Royal Veterinary and Agricultural University, Copenhagen, Denmark This is a compact reference to the language implemented by Moscow ML, a superset of Standard ML. For reference material on Standard ML, see Milner, Tofte, Harper and MacQueen: The Definition of Standard ML , The MIT Press 1997. For a guide to the practical use of Moscow ML, see the Moscow ML Owner’s Manual . For a detailed description of all Moscow ML library modules, see the Moscow ML Library Documentation . Contents 1 Moscow ML’s relation to Standard ML 2 2 Reserved words 2 3 Comments 2 4 Special constants 2 5 Identifiers 3 6 Infixed operators 4 7 Notational conventions used in the grammar 4 8 Grammar for the Moscow ML Core language 5 9 Interactive sessions 7 10 Grammar for the Moscow ML Modules language 8 11 Grammar for the Moscow ML Unit language 11 11.1 Syntax and semantics for units compiled in structure mode 11 11.2 Syntax and semantics for units compiled in toplevel mode 13 12 Further restrictions imposed for Standard ML compliance 14 13 Built-in types, constructors and exceptions 15 14 Built-in variables and functions 16 15 List of all library modules 19 16 The preloaded library modules 21 The Moscow ML home page is http://www.dina.kvl.dk/~sestoft/mosml.html 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
1 Moscow ML’s relation to Standard ML Moscow ML implements a proper extension of Standard ML, as defined in the 1997 Definition of Standard ML . This document describes the language implemented by Moscow ML, not Standard ML per se : users seeking an orthodox Standard ML reference should look elsewhere. Having said that, Moscow ML is specifically designed to be backwards compatible with Standard ML. Thus every valid Standard ML program should be a valid Moscow ML program, and Moscow ML may be used as if it were simply a Standard ML compiler. Any deviation from this behaviour should be reported as a bug. 2 Reserved words abstype and andalso as case do datatype else end eqtype exception fn fun functor handle if in include infix infixr let local nonfix of op open orelse raise rec sharing sig signature struct structure then type val where with withtype while ( ) [ ] { } , : :> ; ... _ | = => -> # 3 Comments A comment is any character sequence within comment brackets (* and *) in which comment brackets are properly nested. 4 Special constants Integer constants Examples: 0 ~0 4 ~04 999999 0xFFFF ~0x1ff Non-examples: 0.0 ~0.0 4.0 1E0 -317 0XFFFF -0x1ff Real constants Examples: 0.7 ~0.7 3.32E5 3E~7 ~3E~7 3e~7 ~3e~7 Non-examples: 23 .3 4.E5 1E2.0 1E+7 1E-7 Word constants Examples: 0w0 0w4 0w999999 0wxFFFF 0wx1ff Non-examples: 0w0.0 ~0w4 -0w4 0w1E0 0wXFFFF 0WxFFFF String constants A string constant is a sequence, between quotes ( " ), of zero or more printable characters, spaces, or escape sequences. An escape sequence starts with the escape character
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/13/2012 for the course CS 91.531 taught by Professor Giam during the Fall '09 term at UMass Lowell.

Page1 / 24

mosmlref - Moscow ML Language Overview Version 2.00 of June...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online