OCaml Tutorial
OCaml Tutorial
Abram Hindle Kitchener Waterloo Perl Monger http://kw.pm.org abez@abez.ca October 19, 2006
Abram Hindle 1
OCaml Tutorial Abram Hindle Kitchener Waterloo Perl Monger - - PowerPoint PPT Presentation
OCaml Tutorial OCaml Tutorial Abram Hindle Kitchener Waterloo Perl Monger http://kw.pm.org abez@abez.ca October 19, 2006 Abram Hindle 1 OCaml Tutorial OCaml Functional Language Multiple paradigms: Imperative, Functional, Object
OCaml Tutorial
Abram Hindle Kitchener Waterloo Perl Monger http://kw.pm.org abez@abez.ca October 19, 2006
Abram Hindle 1
OCaml Tutorial
Abram Hindle 2
OCaml Tutorial
speed than even C++
type safety without obvious hacks.
Abram Hindle 3
OCaml Tutorial
Abram Hindle 4
OCaml Tutorial
Abram Hindle 5
OCaml Tutorial
Abram Hindle 6
OCaml Tutorial
Abram Hindle 7
OCaml Tutorial
Abram Hindle 8
OCaml Tutorial
Abram Hindle 9
OCaml Tutorial
Abram Hindle 10
OCaml Tutorial
Abram Hindle 11
OCaml Tutorial
like mathemtical notation
value of this expression (usually used with Unit expression)
globally accessible functions
it just means match anything or ignore the
Abram Hindle 12
OCaml Tutorial
– type foo = { num : int; mutable name: string }
– let i = ref 0
– (* deref i and add 1 to it and assign it *)
Abram Hindle 13
OCaml Tutorial
synchronization primitives. Even wimpy regexes.
Abram Hindle 14
OCaml Tutorial
Floats and ints don’t share same operator but everything shares ¿, = ,¡ and compare
Abram Hindle 15
OCaml Tutorial
it.
iterate through a linked list)
pass a template into Printf.
Abram Hindle 16
OCaml Tutorial
help debug
integers, make a type like NumWaiters of int to help check the types.
probably won’t help you debug.
converting types or the compiler thinks you are using it wrong.
Abram Hindle 17
OCaml Tutorial
statements which only get run at a compile time.
automation and general scripts.
Abram Hindle 18