initial version - for testing new OO bytecodes like GETPUBMET GETDYNMET

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6361 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Basile Starynkevitch 2004-06-02 09:36:19 +00:00
parent 9d19bcf441
commit 1253881474
1 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,26 @@
(**** file testinterp/t301-object.ml
suggested by Jacques Garrigue to Basile Starynkevitch
compilable with
ocamlc -nostdlib -I ../../stdlib \
../../stdlib/pervasives.cmo ../../stdlib/camlinternalOO.cmo \
t301-object.ml -o t301-object.byte
***)
(* $Id$ *)
class c = object (self)
method pubmet = 1
method privmet = self#pubmet + 1
val o = object method a = 3 method m = 4 end
method dynmet = o#m
end;;
let f () =
let c = new c in
(c#pubmet, c#privmet, c#dynmet);;
ignore (f ());;
(**** eof $Id$ *)