NextAction LetStatement::execute(Env &env, LocalDefs &lds) { ref<Env> e(new Env(env)); fn_def_v cls(fds.size()); for (unsigned int i=0 ; i < cls.size() ; i++) { fn_def fd = fds[i]; if (fd->arity() == 0) { Term val = fd->evaluate_if_args_match(term_v(), lds, env); Expr val_expr = const_expr(val); cls[i] = fn_def(new StdFnDef(fd->name(), val_expr, type(new PseudoTypeAny()))); } else { cls[i] = fn_def(new Closure(fd, e)); } } LocalDefs lds2(cls, lds); return body->execute(env, lds2); }
void testmain(void) { print("macros"); special(); include(); predefined(); simple(); loop(); undef(); cond_incl(); const_expr(); defined(); ifdef(); funclike(); empty(); noarg(); line(); null(); counter(); gnuext(); }