Re: arrays and type variables...

From: Pierre Weis (Pierre.Weis@inria.fr)
Date: Thu Nov 26 1998 - 16:33:18 MET


From: Pierre Weis <Pierre.Weis@inria.fr>
Message-Id: <199811261533.QAA09182@pauillac.inria.fr>
Subject: Re: arrays and type variables...
To: dsyme@microsoft.com (Don Syme)
Date: Thu, 26 Nov 1998 16:33:18 +0100 (MET)
In-Reply-To: <39ADCF833E74D111A2D700805F1951EF0B2EF63B@RED-MSG-06> from "Don Syme" at Nov 25, 98 05:57:03 am

> Shouldn't "[| [] |]" count as a value??
>
> bash$ ocaml
> Objective Caml version 2.00
>
> # let x = [| [] |];;
> val x : '_a list array = [|[]|]
[...]
> Cheers,
> Don

No, we can't, since it is equivalent to create a polymorphic reference
(you just have to put the value into a list and to assign this list to
the vector). This would break the type system's safety theorem: it
would lead to ``bus errors''.

Best regards,

Pierre Weis

INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://cristal.inria.fr/~weis/



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:17 MET