Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Is "let x = 3;;" an expression?

People say everything in ocaml is an expression and has a type. But how can I understand a statement like

let x = 3;

and

let y = x * x;

These do not look like expressions, right?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

OCaml expression are presented here https://v2.ocaml.org/manual/expr.html, and what you have typed is not expressions but let-bindings.

Beware, a single ; is used to separate expressions and is typically used with imperative expressions.

Don’t confuse with ;;

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading