Version française
Home     About     Download     Resources     Contact us    
Browse thread
Re: Array interface question
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Pierre Weis <Pierre.Weis@i...>
Subject: Re: Array interface question
> 	Why is there no creation function which does not take a default
> value for filling the array?
[...]
> 
> -- Brian

This is due to the coexistance in Caml of polymorphism and mutable
values. The system would be unsafe if we were able to allocate
polymorphic mutable values (those mutable values could be filled
afterwards with values of unrelated types, and hence would break the
homogeneous sequence nature of arrays, and then may be read back with
types unrelated to their proper types).

Hope this helps,

Pierre Weis

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