2 ms·
Yawn ... The syntax of OCaml is tremendously regular once you understand it (and the examples he gives there are using the toplevel which indicates he's not us
by rwmj 16y ago
Yawn ... The syntax of OCaml is tremendously regular once you understand it (and the examples he gives there are using the toplevel which indicates he's not used it very much).
Compare the syntax of OCaml (and ML in general) for:
(1) defining functions
(2) defining ordinary variables
(3) static variables
(4) variables scoped to two functions
with the same for your favourite imperative/OO language.
Here's the OCaml syntax:
(1)
let f x = ...
(2)
let v = ...
(3)
let f =
let v = ... in
let f () = ... in
f
(4)
let f, g =
let v = ... in
let f () = ... in
let g () = ... in
f, g