SML has been installed on all Sun workstations (i.e., flat-rock, hendersonville, marshall, brevard, leicester, and alexander) as well as Burnsville (a linux box).
To get you started here are a few basics on running SML:
user.sml
type:
use ["myfile.sml"];
The primary URL is http://cm.bell-labs.com/cm/cs/what/smlnj/index.html. This site contains links to open source implementations of SML as well as many other resources including tutorials.
Two other excellent SML tutorials are:
Examples;
- andalso_list [true,false,true];
val it = false : bool
- andalso_list [];
val it = true : bool
- andalso_list [true,true,true,true];
val it = true : bool
- andalso_list [true,true,true,true,false];
val it = false : bool
Notice that the function should return 'true' when applied to the
empty list.
Examples:
- swap_pairs [(3,2),(4,1),(7,9)];
val it = [(2,3),(1,4),(9,7)] : (int * int) list
- swap_pairs [("foo",2.9),("bar",11.7)];
val it = [(2.9,"foo"),(11.7,"bar")] : (real * string) list
Examples:
- make_trips([1,2,3],["a","b","c"],[true,false,true]);
val it = [(1,"a",true),(2,"b",false),(3,"c",true)] : (int * string * bool) list
- make_trips([["foo"],[],["bar","baz"]],[3,22,4],[(3,2),(1,1),(3,4)]);
val it = [(["foo"],3,(3,2)),([],22,(1,1)),(["bar","baz"],4,(3,4))]
: (string list * int * (int * int)) list
Examples:
- inorder_insert [1,3,5,7,9] 8;
val it = [1,3,5,7,8,9] : int list
- inorder_insert [1,3,5,7,9] 2;
val it = [1,2,3,5,7,9] : int list
- inorder_insert [1,3,5,7,9] 12;
val it = [1,3,5,7,9,12] : int list
- inorder_insert [1,3,5,7,9] 0;
val it = [0,1,3,5,7,9] : int list
Submit an ASCII version of your functions.