![]() | Fun 0.41.5 The programming language that makes You have fun |
Implements the OP_JOIN opcode for joining array elements into a string in the VM. More...

Go to the source code of this file.
Functions | |
| if (arr.type !=VAL_ARRAY||sep.type !=VAL_STRING) | |
| free_value (arr) | |
| free_value (sep) | |
| push_value (vm, out) | |
Variables | |
| case | OP_JOIN |
| Value | arr = pop_value(vm) |
| Value | out = bi_join(&arr, &sep) |
| break | |
Implements the OP_JOIN opcode for joining array elements into a string in the VM.
This file handles the OP_JOIN instruction, which joins the elements of an array into a string using a separator. The separator and array are popped from the stack, and the resulting string is pushed back.
Behavior:
Error Handling:
Example: // Bytecode: OP_JOIN // Stack before: [", ", ["a", "b", "c"]] // Stack after: ["a, b, c"]
Definition in file join.c.
| free_value | ( | arr | ) |
| free_value | ( | sep | ) |
| if | ( | arr.type ! | = VAL_ARRAY || sep.type != VAL_STRING | ) |
| push_value | ( | vm | , |
| out | ) |