![]() | Fun 0.41.5 The programming language that makes You have fun |
Implements the OP_APOP opcode for removing elements from arrays in the VM. More...

Go to the source code of this file.
Functions | |
| if (arr.type !=VAL_ARRAY) | |
| if (!array_pop(&arr, &out)) | |
| free_value (arr) | |
| push_value (vm, out) | |
Variables | |
| case | OP_APOP |
| Value | out |
| break | |
Implements the OP_APOP opcode for removing elements from arrays in the VM.
This file handles the OP_APOP instruction, which removes the last element from an array and pushes the removed element onto the stack. The array is popped from the stack.
Behavior:
Error Handling:
Example: // Bytecode: OP_APOP // Stack before: [[10, 20, 30]] // Stack after: [30]
Definition in file apop.c.
| free_value | ( | arr | ) |
| push_value | ( | vm | , |
| out | ) |