Version française
Home     About     Download     Resources     Contact us    
Browse thread
bottom types and threaded exits
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Markus Mottl <mottl@m...>
Subject: Re: bottom types and threaded exits
On Mon, 02 Oct 2000, Patrick M Doane wrote:
> This may be too obvious to point out, but that statement isn't always
> true. From the Pervasives library:
> 
>   val input_value : in_channel -> 'a
> 
> clearly returns. I don't quite understood why the return type isn't
> a monomorphic type variable though.

The "input_value"-function is unfortunately not type safe: you can "cast"
whatever data you get from the channel to any kind of type - whether this
is correct or not. There is currently no better way to do it if you want to
reconstruct marshalled data (data that was sent with output_value). You
have to trust that the OCaml-data you get is of the type you expect.

Pierre mentioned that there is work going on in this field (a PhD-thesis)
that should make I/O much safer. Is there any news about this?

Best regards,
Markus Mottl

-- 
Markus Mottl, mottl@miss.wu-wien.ac.at, http://miss.wu-wien.ac.at/~mottl