English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Re: [Caml-list] pattern match on class?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-11-25 (05:31)
From: Keiko Nakata <keiko@k...>
Subject: Re: [Caml-list] pattern match on class?
From: skaller <skaller@users.sourceforge.net>

>We have anonymous objects now .. but can one pattern
>match on a class as one can on a record?

I might not understand you correctly,
but I think it is impossible 
if you want something like "instance of" in Java.

Because the run-time does not carry type information of values,
it has no way to know the exact type of an object,
nor whether an object is an instance of a particular class.