jon.recoil.org

Module Stdlib_stable.Idx_mutSource

Mutable indices into blocks.

Sourcetype (('a : value_or_null), ('b : any)) t : bits64 mod everything = ('a, 'b) idx_mut

An alias for the type of mutable indices into blocks.

Sourceval get : ('a : value_or_null) ('b : any). 'a -> ('a, 'b) idx_mut -> 'b

get a i uses the index i to access a.

Sourceval set : ('a : value_or_null) ('b : any). 'a -> ('a, 'b) idx_mut -> 'b -> unit

set a i v uses the index i to set a to v.

It can take a locally and v globally because mutable indices (e.g. to array elements or mutable record fields) can only be created to elements with the global modality.

Sourceval unsafe_create_into_array : ('a : any mod non_float). int -> ('a array, 'a) idx_mut

unsafe_create_into_array i creates an index into the ith element of an array.

This is unsafe because it cannot check array bounds, so calling get/set with the index later could perform an unchecked out-of-bounds access.

Sourceval unsafe_create_into_array_indexed_by_int8 : ('a : any mod non_float). int8# -> ('a array, 'a) idx_mut
Sourceval unsafe_create_into_array_indexed_by_int16 : ('a : any mod non_float). int16# -> ('a array, 'a) idx_mut
Sourceval unsafe_create_into_array_indexed_by_int32 : ('a : any mod non_float). int32# -> ('a array, 'a) idx_mut
Sourceval unsafe_create_into_array_indexed_by_int64 : ('a : any mod non_float). int64# -> ('a array, 'a) idx_mut
Sourceval unsafe_create_into_array_indexed_by_nativeint : ('a : any mod non_float). nativeint# -> ('a array, 'a) idx_mut