Skip to content

Arrays ​

Array mnemonics take registers containing the relevant Array, index, and value. See CandleVM array opcodes for bounds and runtime type behavior.

CASM mnemonicCandleVM opcodeOperandsBehavior
arr_newNewArraydestinationCreates an empty array.
arr_lenArrayLendestination, arrayWrites the array length to destination.
arr_containsArrayContainsdestination, array, valueTests whether the array contains a value equal to value.
arr_getArrayGetdestination, array, indexReads the element at index into destination.
arr_setArraySetarray, index, valueReplaces an existing element at index.
arr_insertArrayInsertarray, index, valueInserts value before index; an index equal to the length appends.
arr_removeArrayRemovearray, indexRemoves and discards the element at index.

Built for the Candle ecosystem · Powered by VitePress.