
El mar., 31 mar. 2020 11:46, Joachim Breitner
Hi,
Am Montag, den 30.03.2020, 21:27 +0200 schrieb Alejandro Serrano Mena:
for me the syntax "r .x", with a space in between the element and the field name, looks completely alien and different from what other languages do [1,2,3]. Furthermore, several examples in C4 are very surprising to me. For example, "f r .x" meaning "f (r.x)".
you list Ocaml here, but that C4 is _precisely_ what Ocaml does (and in my earlier list of options, where I tired to be more systematic about option names, i was called “Ocaml”):
utop # type r = { x : int };; type r = { x : int; } utop # let r = { x = 0 };; val r : r = {x = 0} utop # let f : int -> int = fun n -> n;; val f : int -> int = <fun> utop # f r .x;; - : int = 0
Interesting. I must have misread the spec. So I guess now I find Ocaml surprising too!