Comparing Objective Caml and Standard ML (opens in new tab)
## Objective Caml ## Standard ML ## Syntax See this syntax comparison for more details\. ### Array/string shorthands Special syntactic sugar is defined for array and string accesses\. These operations receive no special treatment\. ``` let arr = [| 1; 2; 3 |];; let two = arr.(1);; arr.(2) 0 (* A' is signaled as an unbound constructor. *) | B -> 1;; ``` ``` datatype myType = a | b; val f = fn a' => 0 (* a' is processed as a variable. *) | b => 1; (* This case is signaled as redundant...
Read the original article