From: Martin Jambon <martin.jambon@ens-lyon.org>
To: Goswin von Brederlow <goswin-v-b@web.de>
Cc: Ashish Agarwal <agarwal1975@gmail.com>, caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Extending modules and signatures
Date: Mon, 20 Apr 2009 13:55:34 +0200 [thread overview]
Message-ID: <49EC62B6.1080003@ens-lyon.org> (raw)
In-Reply-To: <873ac3x5it.fsf@frosties.localdomain>
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/
next prev parent reply other threads:[~2009-04-20 11:59 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-17 20:51 Peter Hawkins
2009-04-17 21:36 ` [Caml-list] " Goswin von Brederlow
2009-04-18 5:47 ` Ashish Agarwal
2009-04-18 14:20 ` Martin Jambon
2009-04-19 21:36 ` Ashish Agarwal
2009-04-19 21:53 ` Jon Harrop
2009-04-20 5:17 ` Goswin von Brederlow
2009-04-20 0:06 ` Martin Jambon
2009-04-20 5:23 ` Goswin von Brederlow
2009-04-20 11:55 ` Martin Jambon [this message]
2009-04-21 16:01 ` Ashish Agarwal
2009-04-17 21:30 Dario Teixeira
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49EC62B6.1080003@ens-lyon.org \
--to=martin.jambon@ens-lyon.org \
--cc=agarwal1975@gmail.com \
--cc=caml-list@yquem.inria.fr \
--cc=goswin-v-b@web.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox