Name: Anonymous 2011-01-21 19:04
Dear /prog/,
Why do only so few people actually use the OCaml Programming language? I've just recently started learning OCaml (in a serious way; I've tried to learn it before, but stopped whenever I've reached the part about classes), and it's actually much much easier to go with than Haskell:
Things I've found a little odd are, that classmembers are accessed via '
Why do only so few people actually use the OCaml Programming language? I've just recently started learning OCaml (in a serious way; I've tried to learn it before, but stopped whenever I've reached the part about classes), and it's actually much much easier to go with than Haskell:
class myClass =
object(self)
initializer self#init
val mutable m_name: string = ""
method init =
Printf.printf "init() called\n";
method setName n =
m_name <- n;
method getName =
m_name;
end;;
let () =
let instance = new myClass in
instance#setName "john";
Printf.printf "name = %s\n" (instance#getName)
;;Things I've found a little odd are, that classmembers are accessed via '
#', and not with a dot... but that's alright. Alltogether, I'd say OCaml is the better Haskell.