This module provides functions which break the declarative semantics of Mars.
Mars is, fundamentally, a pure language. This means that no function can modify an existing value or global state, only return a value (and perform input/output, which while technically impure, isn’t considered “impure” in Mars).
The functions in this module break that purity by modifying their input arguments. They should not be considered part of the language semantics, and are not intended to be used by most code. They are provided to increase performance in certain situations. Use at your own risk.
Returns 1 if x has the same identity as y, 0 otherwise. This performs “reference” equality, such that two values are only considered equal if they are the same object or are directly aliased. If the values are integers, this is the same as eq. It is an error if the values are function objects.
This function breaks the pure semantics of the Mars programming language because in a pure language, it should not be possible to distinguish between two aliased objects and two unaliased objects which are equal.
These functions apply an operation to all values which are aliased to the input array (for which is compares true).
Replaces array element index with value. Returns array. It is an error if array has no element at index.
Appends value onto the end of array. Returns array.
Appends each element of array2 onto the end of array1. Does not modify array2. Returns array1.