Browse thread
Re: Efficency in OCaml
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | chet@w... |
| Subject: | Re: Efficency in OCaml |
Take a small program, e.g.
================================================================
class oa n =
object
val mutable a = n
method get () = a
method set a' = a <- a'
method print_a () = (Printf.printf "A: %d\n" a; flush stdout)
end
;;
print_string "foo\n";;
let ai = new oa 37;;
ai#print_a();;
================================================================
and run
% ocamlc -c -drawlambda o1.ml
on it. Doing so on "oo.ml" (after having compiled "oo.mli" in the
same directory!) will also help illuminate the situation.
--chet--