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
down casting ???
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 1996-06-19 (12:32)
From: FAVRE Jean-Marie <Jean-Marie.Favre@i...>
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 ???