Browse thread
Re: arrays and type variables...
- Pierre Weis
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: | 1998-11-26 (15:38) |
From: | Pierre Weis <Pierre.Weis@i...> |
Subject: | Re: arrays and type variables... |
> 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/