Browse thread
Extending modules and signatures
[
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: | Martin Jambon <martin.jambon@e...> |
| Subject: | Re: [Caml-list] Extending modules and signatures |
Goswin von Brederlow wrote: > Which would also need > > module A1 = new module A > module A2 = new module A > A1.incr_x () > A1.get_x;; > - : int = 124 > A2.get_x ();; > - : int = 123 > > So you see A does not have global variables but only instance > variables. What you describe are ocaml objects. Not modules. The tiny <ahem> difference is that objects may not contain type definitions. Functors do, but they don't support inheritance because all the private members are hidden behind the module interface. Martin -- http://mjambon.com/