patch_seq_list_set

Function patch_seq_list_set 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn patch_seq_list_set(stack: Stack) -> Stack
Expand description

Set an element in a list by index (functional - returns new list)

Stack effect: ( Variant Int Value – Variant Bool )

Returns a new list with the value at the given index replaced, and true. If index is out of bounds, returns the original list and false.

§Error Handling

  • Empty stack: Sets runtime error, returns unchanged stack
  • Type mismatch: Sets runtime error, returns original list and false
  • Out of bounds: Returns original list and false (no error set, this is expected)

§Safety

Stack must have Value on top, Int below, and Variant (list) below that