Colorado State University

Useful Information for SML
Summary



General machines on which SML is available:

  1. schubert
  2. beethoven
  3. mozart
  4. kern
  5. walton


Using the interpreter:


The intepreter prompt is a dash. At this prompt you can:


Showing large data structures:

To control the amount of information that is printed, execute one of:


Common problems you might have:


Basic types and operations:

type values operators
int ...~2, ~1, 0, 1, 2... ~, +, -, *, div, mod <, >, <=, >=, =, <>
booltrue, falsenot, and, or, andalso, orelse
string"abc", "z", etcsize, ^
real0.243, etc~, +, -, *, /,<, >, <=, >=, =, <>,sin, exp, sqrt, etc

type converter functions:
real : int -> real
floor : real -> int


Structured types (built in)

type constructors operations
list ::, nil hd, tl, =, pattern matches
tuples (a), (a,3), (a,3,"x") ... pattern matches

alternate form of list is
[a,b,c] <==> a::b::c::nil
[] <==> nil


User-defined types - EX:



Comments: howe@CS.ColoState.EDU
Copyright © 1998: Colorado State University, CS Department. All rights reserved.