For creating variables in OCaml we need to use the let keyword.
The syntax to create a variable is the following:
# let myVar = 90;;
When you type enter, it will be displayed the type of your variable:
val myVar : int = 90
The OCaml interpreter will find the type by itself.
This mechanism is called the inference.
© Badprog - I want to change the world. And I will.
Add new comment