Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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: -- (:)
From: Keiko Nakata <keiko@k...>
Subject: Re: [Caml-list] pattern match on class?
From: skaller <>

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