I'm trying to figure out how to run the code Standard Meta Language:
smallest [5, ~4, 3]; returns ~4
fun smallest L =
if null (tl L)
then hd L
else if hd L < smallest (tl L)
then hd L
else smallest (tl L);
I'm trying to figure out how to run the code Standard Meta Language:
smallest [5, ~4, 3]; returns ~4
fun smallest L =
if null (tl L)
then hd L
else if hd L < smallest (tl L)
then hd L
else smallest (tl L);
You need an SML interpretor, or compilor. There is multiple to choose from, but SML/NJ is most likely the most known/used.
Others include (but are not limited to) Moscow ML (MosML), MLKit and MLton. Where MLKit and MLton are compilers and SML/NJ and MosML are interpreters.
The wikipedia article on SML is properly a good starting point for you to learn some more about SML.
I recommend PolyML. It's got some of the better documentation for ML out there.