From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA20728; Sun, 22 Sep 2002 11:08:51 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA20412 for ; Sun, 22 Sep 2002 11:08:50 +0200 (MET DST) Received: from favie.faith.gr.jp (favie.faith.gr.jp [61.127.175.250]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g8M98j510952 for ; Sun, 22 Sep 2002 11:08:47 +0200 (MET DST) Received: from localhost (dhcp7.faith.gr.jp [192.168.1.17]) by favie.faith.gr.jp (8.9.3/8.9.3) with ESMTP id SAA16675; Sun, 22 Sep 2002 18:08:20 +0900 To: alex@baretta.com Cc: caml-list@inria.fr Subject: Re: [Caml-list] Polymorphic methods and ellipsis In-Reply-To: <3D8C2F45.7080604@baretta.com> References: <3D8BBCC4.1080906@baretta.com> <3D8C2F45.7080604@baretta.com> X-Mailer: Mew version 1.94.2 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20020922180759X.garrigue@kurims.kyoto-u.ac.jp> Date: Sun, 22 Sep 2002 18:07:59 +0900 From: Jacques Garrigue X-Dispatcher: imput version 20000228(IM140) Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk From: Alessandro Baretta > 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