Ocaml Phrasebook (part 6) Ocaml is mostly assignment-free. This means that a let creates a permanent (immutable) binding. int x = 10; let x = 10 in x = 11; /* assignment */ x = 11 (* boolean; false *) If you want to use assignment, you need to explicitly ask for a "reference" variable, which can have its value accessed with ! or changed with := int x = 10; let x = ref 10 in foo (x) foo (!x); x = 11; x := 11 It is a little awkward, but it encourages you to isolate, and understand, the state you use in a function. You tend to need assignment a lot less than you'd assume. Note: there are no "null" references. You cannot segfault.