GIML: Moscow Notes

This material was developed around the njsml/unix implementation of sml. There are a few trivial problems arising from Moscow ML.

Tutorial One

substring ord chr

These functions have slightly different types. The following declarations will make them behave as they do on njsml

val substring = String.substring;
val ord = ord o hd o explode;
val chr = implode o (fn x=>[x]) o chr;
[Note these these lines must be entered right first time - if you get it wrong leave ML and go back in]

Tutorial Two

Change the definitions given in question 6 to
fun roll s = implode[fourth s,first s,second s,third s];
fun exch s = implode[second s,first s,third s,fourth s];

Tutorial Three

Weird characters. The bar | may not be the character it appears. The UK keyboard can generate character 224 when you press what looks like the bar on the keyboard. It should generate character 124. Both characters look the same.

To ensure that you get the right bar hold the alt key down and enter 124 on the numeric keypad, then release the alt key. Oddly this does not seem to be required if the text is created in an editor and entered into MosML using copy and paste of use.