Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] match on dynamic type
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Olivier Ricordeau <olivier.ricordeau@w...>
Subject: Re: [Caml-list] match on dynamic type
-----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