[uim-commit] r1016 - branches/r5rs/sigscheme
tkng at freedesktop.org
tkng at freedesktop.org
Sun Jul 24 11:47:46 EST 2005
Author: tkng
Date: 2005-07-23 18:47:43 -0700 (Sat, 23 Jul 2005)
New Revision: 1016
Modified:
branches/r5rs/sigscheme/eval.c
Log:
* sigscheme/eval.c: Fixed the bug that closure doesn't work.
-(ScmOp_eval): Call ScmExp_begin instead of ScmOp_eval, because
ScmOp_eval evaluate only first arguments.
-(ScmExp_define): Fixed wrong body was passed to ScmExp_lambda.
Modified: branches/r5rs/sigscheme/eval.c
===================================================================
--- branches/r5rs/sigscheme/eval.c 2005-07-23 22:51:20 UTC (rev 1015)
+++ branches/r5rs/sigscheme/eval.c 2005-07-24 01:47:43 UTC (rev 1016)
@@ -310,7 +310,7 @@
env = extend_environment(SCM_CAR(SCM_CLOSURE_EXP(tmp)),
map_eval(SCM_CDR(obj), env),
SCM_CLOSURE_ENV(tmp));
- return ScmOp_eval(SCM_CAR(SCM_CDR(SCM_CLOSURE_EXP(tmp))), env);
+ return ScmExp_begin(SCM_CDR(SCM_CLOSURE_EXP(tmp)), env);
}
case ScmContinuation:
{
@@ -431,7 +431,7 @@
env = extend_environment(SCM_CAR(SCM_CLOSURE_EXP(proc)),
SCM_CAR(SCM_CDR(args)),
SCM_CLOSURE_ENV(proc));
- return ScmOp_eval(SCM_CAR(SCM_CDR(SCM_CLOSURE_EXP(proc))), env);
+ return ScmExp_begin(SCM_CDR(SCM_CLOSURE_EXP(proc)), env);
}
case ScmEtc:
if (EQ(proc, SCM_QUOTE)) {
@@ -1060,16 +1060,13 @@
if (EQ(ScmOp_listp(var), SCM_TRUE)) {
val = SCM_CAR(var);
formals = SCM_CDR(var);
+ body = SCM_CDR(arg);
if (!SCM_CONSP(formals))
- formals = Scm_NewCons(formals, SCM_NIL);
+ formals = Scm_NewCons(formals, SCM_NIL);
/* (val (lambda (formals) body)) */
- return ScmExp_define(Scm_NewCons(val,
- Scm_NewCons(ScmExp_lambda(Scm_NewCons(formals,
- Scm_NewCons(body, SCM_NIL)),
- env),
- SCM_NIL)),
- env);
+ return ScmExp_define(Scm_NewCons(val, Scm_NewCons(ScmExp_lambda(Scm_NewCons(formals, body), env),
+ SCM_NIL)), env);
}
/*========================================================================
More information about the uim-commit
mailing list