Skip to content

Latest commit

 

History

History
21 lines (12 loc) · 630 Bytes

File metadata and controls

21 lines (12 loc) · 630 Bytes

Tidbits

SML's if then else statement needs the else! Can't get away with if then.

fun is a keyword for declaring functions, so you can't use it for a variable.

Semicolons are optional in the code of the file--they're required in the REPL.

Gotta type val before a new expression!

In the if expression, the then and else have to have matching expressions.

Minus is a binary operation in SML. Can't write val a = - 5...

Negation/negative is the TILDE character!

So you'd write val a = ~5 or val a = 0 - 5

Cannot use / division on integers. That's for floats. Gotta use div! 5 div 4 = 1. div is integer division.