Concatenative language
Concatenative topics
Concatenative meta
Other languages
Meta
ML is a family of general-purpose, strong-typed, non-pure functional languages. The most known derivatives of ML are Standard ML and OCaml. Features: - Supporting both of functional and imperative coding styles - Object oriented programming (OCaml) - Garbage collection - Polymorphic types - Pattern matching - Highly expressive syntax Standard ML implementations: - [[http://mlton.org|MLton]] - [[http://www.dina.kvl.dk/~sestoft/mosml.html|Moscow ML]] - [[http://www.polyml.org/index.html|Poly/ML]] - [[http://www.smlnj.org|SML/NJ]] - Standard ML of New Jersey OCaml: - [[http://caml.inria.fr|OCaml home]] - Distributions and documentation Example code (in OCaml): [{ (* An implementation of the factorial computing function * in different coding styles. * Note that the argument shall be >= 0 **) (* Functional style *) let rec fact_1 n = match n with 0 -> 1 | n -> n * fact_1 (n - 1) ;; (* Imperative style *) let rec fact_2 n = if n = 0 then 1 else n * fact_2 (n - 1) ;; (* Imperative style without the recursion *) let fact_3 n = let result = ref 1 in if n > 0 then for i = 1 to n do result := !result * i done else result := 0; !result ;; }]
Describe this revision:
Save