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 MAA14468; Tue, 14 Oct 2003 12:13:29 +0200 (MET DST) 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 MAA02491 for ; Tue, 14 Oct 2003 12:13:28 +0200 (MET DST) Received: from mailhost.trusted-logic.fr (mailhost.trusted-logic.fr [194.250.150.5]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h9EADQ117801 for ; Tue, 14 Oct 2003 12:13:27 +0200 (MET DST) Received: from ouessant.trusted-logic.fr (ouessant.trusted-logic.fr [192.168.1.201]) by mailhost.trusted-logic.fr (Postfix) with ESMTP id CB9881AD for ; Tue, 14 Oct 2003 12:13:24 +0200 (CEST) Received: (from lacas@localhost) by ouessant.trusted-logic.fr (8.9.3/8.9.3) id MAA00906 for caml-list@inria.fr; Tue, 14 Oct 2003 12:13:24 +0200 Date: Tue, 14 Oct 2003 12:13:24 +0200 From: Samuel Lacas To: caml-list@inria.fr Subject: Re: [Caml-list] implementing the visitor pattern in ocaml Message-ID: <20031014121324.D22981@ouessant.trusted-logic.fr> References: <20031014091112.GB26517@imperium.ph> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0pre3us In-Reply-To: <20031014091112.GB26517@imperium.ph> X-Send-From: ouessant.trusted-logic.fr X-Operating-System: Linux ouessant.trusted-logic.fr 2.2.19 X-Loop: caml-list@inria.fr X-Spam: no; 0.00; samuel:01 lacas:01 samuel:01 lacas:01 caml-list:01 coercions:01 foo:01 foo:01 3.11:99 ocaml:01 pattern:06 visit:92 implementing:07 manual:07 self:10 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi, you need to use coercions here (at least, that's the way it works with me). Simply declare method accept (v : abstractvisitor) = v#visit_foo(self :> foo) in class foo. Have a look at section 3.11 of the manual for more information. Hope this helps, sL ------------------- 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