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 SAA12811; Tue, 22 Jul 2003 18:26:59 +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 SAA32055 for ; Tue, 22 Jul 2003 18:26:58 +0200 (MET DST) Received: from kraid.nerim.net (smtp-102-tuesday.nerim.net [62.4.16.102]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h6MGQvf09794 for ; Tue, 22 Jul 2003 18:26:57 +0200 (MET DST) Received: from wanadoo.fr (ricordeau.net1.nerim.net [213.41.149.166]) by kraid.nerim.net (Postfix) with ESMTP id 960E540E29 for ; Tue, 22 Jul 2003 18:26:55 +0200 (CEST) Message-ID: <3F1D65CF.5090406@wanadoo.fr> Date: Tue, 22 Jul 2003 18:26:55 +0200 From: Olivier Ricordeau User-Agent: Mozilla/5.0 (X11; U; Linux i686; fr-FR; rv:1.4) Gecko/20030630 X-Accept-Language: fr-fr, en-us, en MIME-Version: 1.0 To: caml-list@inria.fr Subject: Re: [Caml-list] match on dynamic type References: <3F1D5DA6.7090602@wanadoo.fr> In-Reply-To: <3F1D5DA6.7090602@wanadoo.fr> X-Enigmail-Version: 0.76.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 hash:01 foo:01 lynx:01 1.2.2:01 inherit:01 olivier:02 match:02 pgp:02 addict:02 gpg:02 message-----:03 wrote:03 dynamic:03 abstract:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Olivier Ricordeau wrote: > Hi! > > I'd like to know how I can make a match on an object's dynamic type. Let > a be an abstract class. Let b and c be two class which inherit from a. > I'd like to write a method which looks like this: > > method foo (bar : a) = > match "a's dynamic type" with I meant: match "bar's dynamic type" with > b -> do_something() > | c -> do_something_else() - -- - -= *Olivier RICORDEAU* =- http://freefolks.org < LibNN addict http://libnn.org > lynx -source http://freefolks.org/key.asc | gpg --import olivier.ricordeau@wanadoo.fr _Might the source be with you_ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQE/HWXPDFRYKP6DJEwRAs9oAJ42L0dNszbpvs9GF8wLsIavyMciSwCfcgMe R0ji03fHPE/Xt1hkymNRwdE= =qXKi -----END PGP SIGNATURE----- ------------------- 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