void branch_ref(caStack* stack) { Term* input0 = (Term*) circa_caller_input_term(stack, 0); Branch* branch = input0->nestedContents; if (branch != NULL) { gc_mark_object_referenced(&branch->header); } set_branch(circa_output(stack, 0), branch); }
// Unpack a state value. Input 1 is the "identifying term" which is used as a key. void unpack_state(caStack* stack) { caValue* container = circa_input(stack, 0); Term* identifyingTerm = (Term*) circa_caller_input_term(stack, 1); caValue* element = get_field(container, unique_name(identifyingTerm)); if (element == NULL) { set_null(circa_output(stack, 0)); } else { copy(element, circa_output(stack, 0)); } }
void refactor__change_function(caStack* stack) { change_function(as_term_ref(circa_input(stack, 0)), (Term*) circa_caller_input_term(stack, 1)); }
void term_ref(caStack* stack) { caTerm* term = circa_caller_input_term(stack, 0); set_term_ref(circa_output(stack, 0), (Term*) term); }