示例#1
0
文件: eval.c 项目: Liutos/liutscm
lisp_object_t let2lambda(lisp_object_t let_form) {
  lisp_object_t vars = let_vars(let_form);
  lisp_object_t vals = let_vals(let_form);
  lisp_object_t body = let_body(let_form);
  lisp_object_t lambda_form = make_lambda_form(vars, body);
  return make_pair(lambda_form, vals);
}
示例#2
0
文件: eval.c 项目: lienhua34/CSchemer
//one arg: exp
static cellpoint let_2_combination(void)
{
	//get the binding vals of let expression
	args_push(args_ref(1));
	reg = let_vals();
	stack_push(&vars_stack, reg);
	//make a lambda expression
	args_push(args_ref(1));
	reg = let_vars();
	stack_push(&vars_stack, reg);
	args_push(args_ref(1));
	reg = let_body();
	args_push(reg);
	args_push(stack_pop(&vars_stack));
	reg = make_lambda();
	//make a combination
	reg = cons(reg, stack_pop(&vars_stack));
	args_pop(1);
	return reg;
}