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
[Caml-list] Looking for a real array
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Eray Ozkural <exa@k...>
Subject: [Caml-list] Looking for a real array
I knew this all along but looks like I neglected that an array is in fact an 
array of pointers rather than an array of contiguous storage blocks in 
memory. Is there a way to get real FORTRAN/C arrays for people who might not 
want this extra level of indirection?

val make : int -> 'a -> 'a array
 Array.make n x returns a fresh array of length n, initialized with x. All the 
elements of this new array are initially physically equal to x (in the sense 
of the == predicate). Consequently, if x is mutable, it is shared among all 
elements of the array, and modifying x through one of the array entries will 
modify all other entries at the same time. 


Eray Ozkural (exa) <>
Comp. Sci. Dept., Bilkent University, Ankara  KDE Project:
www:  Malfunction:
GPG public key fingerprint: 360C 852F 88B0 A745 F31B  EA0F 7C07 AE16 874D 539C

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: