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 RAA13317; Tue, 22 Jul 2003 17:52:09 +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 RAA23901 for ; Tue, 22 Jul 2003 17:52:08 +0200 (MET DST) Received: from kraid.nerim.net (smtp-102-tuesday.nerim.net [62.4.16.102]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h6MFq8T20625 for ; Tue, 22 Jul 2003 17:52:08 +0200 (MET DST) Received: from wanadoo.fr (ricordeau.net1.nerim.net [213.41.149.166]) by kraid.nerim.net (Postfix) with ESMTP id 0C8AF40E2F for ; Tue, 22 Jul 2003 17:52:07 +0200 (CEST) Message-ID: <3F1D5DA6.7090602@wanadoo.fr> Date: Tue, 22 Jul 2003 17:52:06 +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: [Caml-list] match on dynamic type 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; hash:01 foo:01 lynx:01 1.2.2:01 inherit:01 olivier:02 match:02 pgp:02 addict:02 gpg:02 message-----:03 dynamic:03 abstract:03 let:04 gnu:05 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 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 b -> do_something() | c -> do_something_else() If anyone of you could explain me how to do this... Google didn't really help me about this, and I didn't find the answer (which is quite rare :) ) in the O'Reilly book. Cheers - -- - -= *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/HV2lDFRYKP6DJEwRAp+uAKCmOsWZT10GrNvuJxd1NFte4mmBfACdHrTC 0IBIrPJscI5kZHwqw1+gx2Q= =MVAg -----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