15 Semicolon

Now the semicolon operator, also known as the sequence operator, becomes more useful.

The semicolon is almost just syntactic sugar

e1; e2
(* is almost the same as *)
let () = e1 in e2

Except... it's not true that e1 : unit

Here, our function prints adds integers, and prints and returns the result.

This works because print_int and print_newline both return unit

But what if we wanted to chain functions that don't return units?

We get a warning! Let's use the ignore function to fix this

That's better!