From: "Correnson Loïc" <Loic.Correnson@trusted-logic.fr>
To: "Ocaml" <caml-list@inria.fr>
Subject: Re: [Caml-list] Delegation based OO
Date: Tue, 23 Mar 2004 09:56:39 +0100 [thread overview]
Message-ID: <00a401c410b4$c135c220$0203a8c0@hoedic> (raw)
In-Reply-To: <405EBD5D.1000406@baretta.com>
This is a very interesting way of OO-programming.
More over, it allows to fullly benefit from multi-inheritance:
Suppose we have:
class type a = object ... end
class type b = object ... end
Then:
class a_and_b = object
delegates [classtype to] a ;
delegates [classtype to] b ;
end
I mainly found the requirement for such a delegation mechanism while looking
at GUI system, where classes have in general a *lot* of methods that must be
delgated by hand.
>From the compiler point of view, notice that such a delegation mechanism
would be concistent with the one already existing for modules (and
functors) thanks to the "include" statement:
module type A = sig ... end
module type B = sig ... end
module A_and_B(mA : A)(mB : B) = struct
include mA [ : A] ;
include mB [ : B] ;
end
>From an academic point of view, and looking for a beautiful symetry between
objects and modules, such an delegation-based OO system would be a nice
construction.
Loic Correnson.
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
prev parent reply other threads:[~2004-03-23 8:51 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-22 10:18 Alex Baretta
2004-03-22 23:01 ` Yamagata Yoriyuki
2004-03-23 0:29 ` Kenneth Knowles
2004-03-23 23:43 ` Yamagata Yoriyuki
2004-03-24 0:45 ` Kenneth Knowles
2004-03-24 10:43 ` Alex Baretta
2004-03-24 14:11 ` Yamagata Yoriyuki
2004-03-24 15:00 ` Alex Baretta
2004-03-24 16:57 ` Kenneth Knowles
2004-03-23 1:14 ` Jacques Garrigue
2004-03-23 7:27 ` Alex Baretta
2004-03-23 9:01 ` Stefano Zacchiroli
2004-03-23 9:41 ` Alex Baretta
2004-03-23 9:44 ` Jacques Garrigue
2004-03-23 9:47 ` Stefano Zacchiroli
2004-03-23 8:56 ` Correnson Loïc [this message]
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='00a401c410b4$c135c220$0203a8c0@hoedic' \
--to=loic.correnson@trusted-logic.fr \
--cc=caml-list@inria.fr \
/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