Ion Fusion Documentation
Release 0.38a1-SNAPSHOT (2026-04-16T19:45:37.790Z)

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.

unsafe_list_add procedure
(unsafe_list_add list value)

Returns a list similar to list with the value added to the end.

unsafe_list_add_m procedure
(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 procedure
(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 procedure
(unsafe_list_iterator list)

Returns an iterator over the content of list.

unsafe_list_set procedure
(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 procedure
(unsafe_list_size list)

Returns the number of elements in list.

unsafe_list_subseq procedure
(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 procedure
(unsafe_list_to_immutable_list list)

Returns an immutable list with the same content as list. If list is immutable, then it is returned.