Re: Efficency in OCaml

From: chet@watson.ibm.com
Date: Fri Sep 10 1999 - 21:03:41 MET DST


From: chet@watson.ibm.com
Message-Id: <199909101903.PAA01514@bismarck.chet.org>
To: Hendrik Tews <tews@tcs.inf.tu-dresden.de>
Subject: Re: Efficency in OCaml
Date: Fri, 10 Sep 1999 15:03:41 -0400

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--



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:25 MET