Sunday, 6 May 2012

Why are tuples semicolon-separated in F#?

Tuples are common in ML and using ; lets you write a lists of pairs by mingling both commas and semicolons like this:
[1, 2; 3, 4]
Historically, F# inherited this syntax from OCaml which created it in order to remove more superfluous parentheses from Standard ML syntax. Some say it was a prolonged allergic response to having used Lisp.

No comments: