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 TAA17271; Tue, 15 Jan 2002 19:57:05 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA17464 for ; Tue, 15 Jan 2002 19:57:04 +0100 (MET) Received: from mel-rto4.wanadoo.fr (smtp-out-4.wanadoo.fr [193.252.19.23]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g0FIv4b13031 for ; Tue, 15 Jan 2002 19:57:04 +0100 (MET) Received: from mel-rta1.wanadoo.fr (193.252.19.150) by mel-rto4.wanadoo.fr; 15 Jan 2002 19:57:04 +0100 Received: from debian (80.8.74.104) by mel-rta1.wanadoo.fr; 15 Jan 2002 19:56:51 +0100 Received: from moi by debian with local (Exim 3.33 #1 (Debian)) id 16QYlP-0002sb-00 for ; Tue, 15 Jan 2002 19:56:51 +0100 To: caml-list@inria.fr Subject: Re: [Caml-list] Class Events References: <004a01c19df4$422470b0$9600a8c0@warp> From: Remi VANICAT Date: 15 Jan 2002 19:56:51 +0100 In-Reply-To: <004a01c19df4$422470b0$9600a8c0@warp> Message-ID: <87zo3f5tos.dlv@wanadoo.fr> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 8bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk "Warp" writes: > Hello, i'm trying to have my class having some event callback like this : > > class wmenuitem (fcallback:wmenuitem->unit) = > object(self) > val func = fcallback > method activate = (func self) > end > > but I'm having : > > This expression has type < activate : 'a; .. > but is here used with type > wmenuitem = < .. > > Self type cannot escape its class > > Is it really true that self cannot be a parameter ? > Any help ? Yes : let the compiler guess the type : class wmenuitem (fcallback:'a -> unit) = object(self) val func = fcallback method activate = (func self) end -- Rémi Vanicat vanicat@labri.u-bordeaux.fr http://dept-info.labri.u-bordeaux.fr/~vanicat ------------------- 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