Exemplo n.º 1
0
//one arg: ops
static cellpoint list_of_values(void)
{
	args_push(args_ref(1));
	reg = no_operands();
	if (is_true(reg)){
		reg = NIL;
	}else {
		//get the first operand
		args_push(args_ref(1));
		reg = first_operand();
		//eval the first operand with tail_context is a_false
		args_push(a_false);
		args_push(reg);
		reg = eval();
		stack_push(&vars_stack, reg);
		//eval the rest operands
		args_push(args_ref(1));
		reg = rest_operands();
		args_push(reg);
		reg = list_of_values();
		
		reg = cons(stack_pop(&vars_stack), reg);
	}
	args_pop(1);
	return reg;
}
Exemplo n.º 2
0
static pSlipObject list_of_values(pSlip gd, pSlipObject exps, pSlipEnvironment env)
{
	if (is_no_operands(gd, exps) == S_TRUE)
	{
		return gd->singleton_EmptyList;
	}
	else
	{
		pSlipObject x;

		x = slip_eval(gd, first_operand(exps), env);
		if (x == NULL)
			x = gd->singleton_Nil;

		return cons(gd, x, list_of_values(gd, rest_operands(exps), env));
	}
}
Exemplo n.º 3
0
object *list_of_values(object *exps, object *env) {
    return is_no_operands(exps) ?
        empty_list() :
        cons(eval(first_operand(exps), env), list_of_values(rest_operands(exps), env));
}