Version française
Home     About     Download     Resources     Contact us    
Browse thread
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Nicolas Ollinger <nollinge@e...>
Subject:
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>
---------------------------------------------------------------------