static object *eval_definition(object *exp, object *env) { define_variable(definition_variable(exp), bs_eval(definition_value(exp), env), env); return lookup_symbol("ok"); }
pSlipObject eval_definition(pSlip gd, pSlipObject exp, pSlipEnvironment env) { pSlipObject a2; pSlipObject x1; pSlipObject x2; x1 = definition_value(gd, exp, env); assert(x1 != NULL); a2 = slip_eval(gd, x1, env); assert(a2 != NULL); x2 = definition_variable(exp); assert(x2 != NULL); define_variable(gd, x2, a2, env); if (gd->running == SLIP_RUNNING) return gd->singleton_OKSymbol; else return gd->singleton_False; }
//one arg: exp static cellpoint eval_definition(void) { //calls definition_variable args_push(args_ref(1)); reg = definition_variable(); stack_push(&vars_stack, reg); //compute definition value args_push(args_ref(1)); reg = definition_value(); args_push(a_false); args_push(reg); reg = eval(); stack_push(&vars_stack, reg); //calls define_var args_push(current_env); args_push(stack_pop(&vars_stack)); args_push(stack_pop(&vars_stack)); define_var(); args_pop(1); return make_symbol("ok"); }
object *eval_definition(object *exp, object *env) { define_variable(definition_variable(exp), eval(definition_value(exp), env), env); return ok_symbol(); }
sexp define2set(sexp form) { return LIST(S("set!"), definition_variable(form), definition_value(form)); }