Functional core of Objective CAML:
http://caml.inria.fr/pub/docs/oreilly-book/html/book-ora015.htmlVariables are variable:
# letp=10;;val p : int = 10
# letkx=(x,p,x+p);;val k : int -> int * int * int =
# kp;;- : int * int * int = 10, 10, 20
# letp=1000;;val p : int = 1000
# kp;;- : int * int * int = 1000, 10, 1010
http://caml.inria.fr/pub/docs/manual-ocaml/expr.html
Looping:while expr1 do expr2 done
for name = expr1 to expr2 do expr3 done
for name = expr1 downto expr2 do expr3 done
Exceptions: try ... with ... -> ...
Objects
Coercion (casting to superclass): subobject :> superclass
Message sending (calling method on object): object # method
Object duplication: Oo.copy
Recursive functions: rec
String concatenation: ^
Characters delimited by ` not ': `a`
http://caml.inria.fr/pub/docs/oreilly-book/html/book-ora016.html#toc21
Tuples
Records
Sum Types
Constant Constructor: typesuit=Spades|Hearts|Diamonds|Clubs;;
Constructor with Args: typecard=Kingofsuit|Queenofsuit|Knightofsuit|Knaveofsuit|Minor_cardofsuit*int|Trumpofint|Joker;;
Recursive Types
Parameterised Types: type('a,'b)list2=