From: Claudio Sacerdoti Coen <sacerdot@cs.unibo.it>
To: Laurent Vibert <lvibert@irisa.fr>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Recursive classes and subtyping
Date: Fri, 1 Feb 2002 18:20:57 +0100 [thread overview]
Message-ID: <20020201182057.C5484@cs.unibo.it> (raw)
In-Reply-To: <20020201180117.A5484@cs.unibo.it>; from sacerdot@CS.UniBO.IT on Fri, Feb 01, 2002 at 06:01:17PM +0100
> It works, thanks!!!
Obviously, I was a bit too quick! I think that the trick works only up to
the point where the mutual recursion is fake. This is a slightly more
complex example:
# type -'a t;;
# let f (x : [> `A] t) = (x : [`A] t);;
# class c (newd : [> `A] t -> d) (obj : [> `A] t) =
object
method d = newd (f obj)
end
and d (newc : [> `A] t -> c) (obj : [> `A] t) =
object
method c = newc (f obj)
end
;;
class c : ([ `A] t -> d) -> [ `A] t -> object method d : d end
class d : ([ `A] t -> c) -> [ `A] t -> object method c : c end
I leave it for the real ocaml gurus!
Regards,
C.S.C.
--
----------------------------------------------------------------
Real name: Claudio Sacerdoti Coen
PhD Student in Computer Science at University of Bologna
E-mail: sacerdot@cs.unibo.it
http://caristudenti.cs.unibo.it/~sacerdot
----------------------------------------------------------------
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
next prev parent reply other threads:[~2002-02-01 17:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-02-01 12:17 Frederic Tronel
2002-02-01 13:34 ` Jerome Vouillon
2002-02-01 13:42 ` Frederic Tronel
2002-02-01 14:55 ` Claudio Sacerdoti Coen
2002-02-01 15:12 ` Claudio Sacerdoti Coen
2002-02-01 16:41 ` Laurent Vibert
2002-02-01 17:01 ` Claudio Sacerdoti Coen
2002-02-01 17:20 ` Claudio Sacerdoti Coen [this message]
2002-02-04 2:30 ` Jacques Garrigue
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=20020201182057.C5484@cs.unibo.it \
--to=sacerdot@cs.unibo.it \
--cc=caml-list@inria.fr \
--cc=lvibert@irisa.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