OCaml let … in

The let x = e1 in e2 construct in OCaml is an expression that allows you to create a new variable binding and use it within a specific scope. It works as follows: The first step is to evaluate the expression e1 to a value v. For example, in the expression let x = 2 + 2 in x * x, the value of e1 is 2 + 2 which evaluates to 4.
Read more →

OCaml fundamentals

In OCaml, an expression is a piece of code that can be evaluated to a value. For example, 1 + 2 is an expression that evaluates to the value 3. Evaluation is the process of computing the value of an expression. Evaluation is performed by the OCaml interpreter or compiler. For example, when the OCaml interpreter encounters the expression 1 + 2, it evaluates it to the value 3. Here are some examples of expressions, values, and evaluation in OCaml:
Read more →