caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] match on dynamic type
@ 2003-07-22 15:52 Olivier Ricordeau
  2003-07-22 16:26 ` Olivier Ricordeau
  0 siblings, 1 reply; 3+ messages in thread
From: Olivier Ricordeau @ 2003-07-22 15:52 UTC (permalink / raw)
  To: caml-list

-----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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-07-22 17:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-22 15:52 [Caml-list] match on dynamic type Olivier Ricordeau
2003-07-22 16:26 ` Olivier Ricordeau
2003-07-22 17:45   ` Olivier Ricordeau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).