Module /fusion/unsafe/list
Unsafe (but fast) operations on lists.
These operations perform no type-checking or bounds-checking, and they will crash or exhibit other unspecified behavior if called with invalid arguments. Use with extreme caution!
See the module /fusion/list for more information and
related operations on lists.
Exported Bindings
(unsafe_list_add list value)
Returns a list similar to list with the value added to the end.
(unsafe_list_add_m list value)
Returns a list similar to list with the value added to the end. The result
may share structure with the list, which may also be mutated.
In particular, when given a stretchy list, the input is expanded to contain the
given value, and the result is the list argument.
(unsafe_list_element list pos)
Returns the element of list at (zero-based) position pos. The pos must be
a non-null int with a valid value.
(unsafe_list_iterator list)
Returns an iterator over the content of list.
(unsafe_list_set list pos value)
Changes the element of list at (zero-based) position pos. This assumes that
the list is mutable and that the pos is valid.
(unsafe_list_size list)
Returns the number of elements in list.
(unsafe_list_subseq list from to)
Returns a list holding the elements from list between positions from and
to. The following precondition applies:
0 <= from <= to <= (size list)
The result may share structure with list.
(unsafe_list_to_immutable_list list)
Returns an immutable list with the same content as list.
If list is immutable, then it is returned.