From: Gerd Stolpmann <Gerd.Stolpmann@darmstadt.netsurf.de>
To: caml-list@inria.fr
Subject: The option -rectypes
Date: Wed, 24 Nov 1999 01:59:36 +0100 [thread overview]
Message-ID: <99112402223302.32002@ice> (raw)
I have some code that compiled in 2.02, but in 2.03 I need the new option
-rectypes of the compilers.
My class definitions look like (the signatures)
class type [ 'node ] extension =
object ('self)
method clone : 'self
method node : 'node
method set_node : 'node -> unit
end
;;
class type [ 'ext ] node =
object ('self)
constraint 'ext = 'ext node #extension
method extension : 'ext
(* ... more methods ... *)
end
;;
This works in both versions out of the box. If I add
val f : 'a node extension as 'a
the 2.03 compiler only accepts the type if I add -rectypes. I have several
questions:
- What is the effect of -rectypes? (I did not find a good explanation in the
manual.)
- What is the background of this change?
- I have thought about the type 'a node extension as 'a. If I apply the
constraint of "node", the condition must hold that
('a node extension as 'a) node extension
unifies with
('a node extension as 'a) node #extension
Normally, a closed class type does not unify with an open class type,
and I wonder why this is accepted at all.
Without -rectypes, the 2.03 compiler only accepts
val f : 'a node #extension as 'a
but this is a much more difficult type.
Gerd
--
----------------------------------------------------------------------------
Gerd Stolpmann Telefon: +49 6151 997705 (privat)
Viktoriastr. 100
64293 Darmstadt EMail: Gerd.Stolpmann@darmstadt.netsurf.de (privat)
Germany
----------------------------------------------------------------------------
next reply other threads:[~1999-11-24 8:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-11-24 0:59 Gerd Stolpmann [this message]
1999-11-24 10:37 ` Pascal Cuoq
1999-11-24 20:56 ` Xavier Leroy
1999-11-25 10:53 ` Anton Moscal
1999-11-25 17:22 ` Stefan Monnier
1999-11-25 20:51 ` Gerd Stolpmann
1999-11-25 22:44 ` Jerome Vouillon
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=99112402223302.32002@ice \
--to=gerd.stolpmann@darmstadt.netsurf.de \
--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