Immutable
A module to contain shared methods that apply to both List (type) and Dictionary (type) immutable objects.
Can also be used to access List and Dictionary classes and methods. See Accessing data methods for more information.
Functions
Draft
thawReturns a primitive table, unfrozen (thawed) at the top level. Nested references to other Immutables will not be thawed.
Used internally when performing operations on Immutables.
Returns an array if the input Immutable was a List, or a dictionary if the input Immutable was a Dictionary.
Thaw
thawReturns a primitive table, unfrozen (thawed) deeply. All nested references to other Immutables will be thawed.
Returns an array if the input Immutable was a List, or a dictionary if the input Immutable was a Dictionary.
Equals
compareReturns true if the two Immutables are deeply equal by value.
Get
evaluateImmutable.Get(key: string | integer,--
The index for a List, or the key for a Dictionary.
default: any | nil--
The default value to return if the key doesn't exist.
) → any | nilReturns the value at the specified key or index, or nil if it doesn't exist.
Set
manipulateImmutable.Set(key: string | integer,--
The index for a List, or the key for a Dictionary.
value: any--
The value to set.
) → Immutable--
The new Immutable with updated values.
Returns a new Immutable with the new value set at the specified key or index.
If the Immutable is a List, the index must be within the bounds of the List or the next index after the last element.
Update
manipulateImmutable.Update(key: string | integer,--
The index for a List, or the key for a Dictionary.
updater: (any) → any--
A function that takes the existing value at key and returns a new value to set.
) → Immutable--
The new Immutable with updated values.
Returns a new Immutable with the result of updater[key] set at the specified key or index.
If the Immutable is a List, the index must be within the bounds of the List or the next index after the last element.