caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jacques Garrigue <garrigue@kurims.kyoto-u.ac.jp>
To: zack@bononia.it
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Delegation based OO
Date: Tue, 23 Mar 2004 18:44:19 +0900	[thread overview]
Message-ID: <20040323184419A.garrigue@kurims.kyoto-u.ac.jp> (raw)
In-Reply-To: <20040323090150.GA7965@fistandantilus.takhisis.org>

From: Stefano Zacchiroli <zack@bononia.it>
> On Tue, Mar 23, 2004 at 10:14:02AM +0900, Jacques Garrigue wrote:
> > Note however that one needs to know more clearly which methods are to
> > be delegated, so I would rather favor a notation like:
> > 
> >  class does_more an_object = object
> >     delegate does_something to an_object
> >     ...
> >  end
> 
> Isn't enough to have a (closed) object type annotation for "an_object"?
> In this way you would now exactly the signature of the object to which
> you want to delegate without having to enumerate all of them.

Looks like there is a misunderstanding here: in Alex's example,
does_something was an object type. So yes, the above amounts to an
object type annotation, and declares simultaneously all the methods
included in the type.
The idea is to have something similar to variant dispatch
   function #super_a as x -> ... | #super_b as x -> ... | #super_c as x -> ...

Jacques Garrigue

-------------------
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


  parent reply	other threads:[~2004-03-23  9:44 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 [this message]
2004-03-23  9:47       ` Stefano Zacchiroli
2004-03-23  8:56 ` Correnson Loïc

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=20040323184419A.garrigue@kurims.kyoto-u.ac.jp \
    --to=garrigue@kurims.kyoto-u.ac.jp \
    --cc=caml-list@inria.fr \
    --cc=zack@bononia.it \
    /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;
as well as URLs for NNTP newsgroup(s).