From: Jacques Garrigue <garrigue@kurims.kyoto-u.ac.jp>
To: alex@baretta.com
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Polymorphic methods and ellipsis
Date: Sun, 22 Sep 2002 18:07:59 +0900 [thread overview]
Message-ID: <20020922180759X.garrigue@kurims.kyoto-u.ac.jp> (raw)
In-Reply-To: <3D8C2F45.7080604@baretta.com>
From: Alessandro Baretta <alex@baretta.com>
> At any rate, why does my technique not work?
>
> class salutation : object
> method greet : 'a. (#parent as 'a) -> string
> end = object
> method greet obj -> obj # foo ^ obj # bar
> end
You can see the above (and it is more or less type the same way) as
class salutation0 = object
method greet obj -> obj # foo ^ obj # bar
end
class salutation : object
method greet : 'a. (#parent as 'a) -> string
end = salutation0
So you see that your constraint is applied too late: salutation0
itself is not typable.
I though at some time of attempting to make this work, since something
like that is already done for recursive functions for instance, but
that's not regular. In fact, you would probably end up wanting to
write the implementation in the .ml and the interface in the .mli, and
this would not work anyway.
So, there is a deep problem about which constraints apply
where. The examples in the tutorial give you the way to do that
without ambiguity.
Jacques
-------------------
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
next prev parent reply other threads:[~2002-09-22 9:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-21 0:26 Alessandro Baretta
2002-09-21 0:31 ` Pixel
2002-09-21 8:35 ` Alessandro Baretta
2002-09-22 9:07 ` Jacques Garrigue [this message]
2002-09-22 9:39 ` Alessandro Baretta
2002-09-22 17:09 ` brogoff
2002-09-24 9:04 ` Alessandro Baretta
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=20020922180759X.garrigue@kurims.kyoto-u.ac.jp \
--to=garrigue@kurims.kyoto-u.ac.jp \
--cc=alex@baretta.com \
--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