Arrays
Array mnemonics take registers containing the relevant Array, index, and value. See CandleVM array opcodes for bounds and runtime type behavior.
| CASM mnemonic | CandleVM opcode | Operands | Behavior |
|---|---|---|---|
arr_new | NewArray | destination | Creates an empty array. |
arr_len | ArrayLen | destination, array | Writes the array length to destination. |
arr_contains | ArrayContains | destination, array, value | Tests whether the array contains a value equal to value. |
arr_get | ArrayGet | destination, array, index | Reads the element at index into destination. |
arr_set | ArraySet | array, index, value | Replaces an existing element at index. |
arr_insert | ArrayInsert | array, index, value | Inserts value before index; an index equal to the length appends. |
arr_remove | ArrayRemove | array, index | Removes and discards the element at index. |