Date: Tue, 11 May 1999 19:03:11 +0200 (MET DST)
From: Nicolas Ollinger <nollinge@ens-lyon.fr>
To: caml-list@inria.fr
Hi,
(* Bad english follows, sorry for purists ;) *)
After playing with ocaml2instr and objprint (two tools for investigation
of the OCaml bytecode and data representation available via the url
http://www.ens-lyon.fr/~nollinge/camel), there are still some obscure
question I would ask concerning objects implementation:
1 - Could someone give a more in deep (than in the Interfacing Caml with C
in the documentation) description of OCaml new object classes and
instances encoding ?
Here is what I understood about it: an instance is a boxed value
tagged Object_tag with n+1 fields where n is the number of instance
variables (including inherited variables):
fields 3..n: the variables.
field 2: something like a class index ?
field 1: a boxed value containing 33 elements: when unused
each field contain a 0 unboxed value. Otherwise,
there is a closure (pointing to the methods ???)
in each field. I suppose that the last one is
used when there are more than 32 methods ?
2 - When using dynlinking with marshalling (I suppose here that it is
possible but I know that in the standard distribution of OCaml it
is NOT), is it necessary to load .cmo files containing classes in the
same order as when the instances of these classes where created ?
Thanks in advance for your help,
Nicolas.
-- +-------------------------------------------------------------------+ |Nicolas Ollinger -=Nopid=- <nollinge@ens-lyon.fr>| +-------------------------------------------------------------------+ ENS Lyon - Magistere Informatique et Modelisation - 2eme Annee DMI97 Student <http://www.ens-lyon.fr/~nollinge> ---------------------------------------------------------------------
This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:22 MET