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 GAA29584; Tue, 16 Jul 2002 06:48:45 +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 GAA29593 for ; Tue, 16 Jul 2002 06:48:44 +0200 (MET DST) Received: from dewberry.cc.columbia.edu (dewberry.cc.columbia.edu [128.59.59.68]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g6G4mgb21749; Tue, 16 Jul 2002 06:48:43 +0200 (MET DST) Received: from there (tw304h3.cpmc.columbia.edu [156.111.84.180]) by dewberry.cc.columbia.edu (8.9.3/8.9.3) with SMTP id AAA02784; Tue, 16 Jul 2002 00:48:42 -0400 (EDT) Message-Id: <200207160448.AAA02784@dewberry.cc.columbia.edu> Content-Type: text/plain; charset="iso-8859-1" From: Oleg To: Xavier Leroy Subject: Re: [Caml-list] Five Questions about Objects Date: Tue, 16 Jul 2002 00:49:04 -0400 X-Mailer: KMail [version 1.3.2] Cc: caml-list@inria.fr References: <200207131340.JAA07158@hickory.cc.columbia.edu> <20020714174734.E28103@pauillac.inria.fr> In-Reply-To: <20020714174734.E28103@pauillac.inria.fr> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Sunday 14 July 2002 11:47 am, Xavier Leroy wrote: > > 4) Can I construct an object that the following function f would accept? > > # let f a = a#m1 (); a#b#m2 ();; > > val f : < b : < m2 : unit -> 'a; .. >; m1 : unit -> 'b; .. > -> 'a = > > [...] > As for your example, just read the type of f aloud: the argument to f > should be an object having at least an "m1" method and a "b" method; > "b" should return an object having at least an "m2" method. To me, " b : < m2 : unit -> 'a; ...>" seems to mean the following: "b" IS an object having at least "m2" method of type "unit -> 'a". Just like m1 is "m1 : unit -> 'b" above, not "m1 : 'b". Had the toplevel said val f : < b : unit -> < m2 : unit -> 'a; .. >; m1 : unit -> 'b; .. > -> 'a It would have meant the same thing to me as it does to you in its present reading. Regards, Oleg ------------------- 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