down casting ???

FAVRE Jean-Marie (Jean-Marie.Favre@imag.fr)
Wed, 19 Jun 1996 09:03:01 +0200

From: "FAVRE Jean-Marie" <Jean-Marie.Favre@imag.fr>
Message-Id: <9606190903.ZM4853@tassili>
Date: Wed, 19 Jun 1996 09:03:01 +0200
To: caml-list@pauillac.inria.fr
Subject: down casting ???

the :> operator make possible to coerce an expression from a type t1 to a
super type t (this coercion is safe), but how to go from t to t1 ???
(ok, a dynamic check is need, this operation can raise an exception)

When one use collections of object, this kind of feature is useful. isn't it ?

I first believed that using pattern like (x : t1) -> can do the job,
(a kind of typecase construction as it is the case in modula 3).

is it possible ???

Jean-marie

--