diff options
Diffstat (limited to 'stdlib/array.mli')
-rw-r--r-- | stdlib/array.mli | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/stdlib/array.mli b/stdlib/array.mli index 343565f5a..3815161f7 100644 --- a/stdlib/array.mli +++ b/stdlib/array.mli @@ -28,16 +28,18 @@ external set: 'a array -> int -> 'a -> unit = "%array_safe_set" Raise [Invalid_argument "Array.set"] if [n] is outside the range 0 to [Array.length a - 1]. You can also write [a.(n) <- x] instead of [Array.set a n x]. *) +external make: int -> 'a -> 'a array = "make_vect" external create: int -> 'a -> 'a array = "make_vect" - (* [Array.create n x] returns a fresh array of length [n], + (* [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. *) +val make_matrix: int -> int -> 'a -> 'a array array val create_matrix: int -> int -> 'a -> 'a array array - (* [Array.create_matrix dimx dimy e] returns a two-dimensional array + (* [Array.make_matrix dimx dimy e] returns a two-dimensional array (an array of arrays) with first dimension [dimx] and second dimension [dimy]. All the elements of this new matrix are initially physically equal to [e]. |