UNSAFE_MONO_ARRAY
signature
signature UNSAFE_MONO_ARRAY
For those of you that don't mind a little insecurity if only your array accesses don't have bounds checks, here are some unchecked operations on arrays.
These operations work on ordinary monomorphic arrays, so you can mix checked and unchecked operations on the same arrays.
In an ideal world (which we're working on, in principle) the compiler would let you use the ordinary checked operations and then optimize the checks away in a safe and efficient manner.
type array
type elem
val sub : (array * int) -> elem
val update : (array * int * elem) -> unit
val create : int -> array
type array
type elem
sub (a, i)
update (a, i, x)
create i
MONO_ARRAY, UNSAFE_MONO_VECTOR, Unsafe.Array
Last Modified October 28, 1997
Comments to sml-nj@research.bell-labs.com
Copyright © 1998 Bell Labs, Lucent Technologies