[uim-commit] r1641 - branches/r5rs/sigscheme
yamaken at freedesktop.org
yamaken at freedesktop.org
Wed Sep 28 02:17:36 PDT 2005
Author: yamaken
Date: 2005-09-28 02:17:34 -0700 (Wed, 28 Sep 2005)
New Revision: 1641
Modified:
branches/r5rs/sigscheme/eval.c
Log:
* sigscheme/eval.c
- (ScmExp_and, ScmExp_or):
* Make error handling meaningful
* Rename 'obj' to 'val' to indicate its role
Modified: branches/r5rs/sigscheme/eval.c
===================================================================
--- branches/r5rs/sigscheme/eval.c 2005-09-28 08:57:16 UTC (rev 1640)
+++ branches/r5rs/sigscheme/eval.c 2005-09-28 09:17:34 UTC (rev 1641)
@@ -994,48 +994,46 @@
{
ScmObj env = eval_state->env;
ScmObj lst = args;
- ScmObj obj = SCM_FALSE;
+ ScmObj val = SCM_FALSE;
if (NULLP(lst))
return SCM_TRUE;
for (; CONSP(CDR(lst)); lst = CDR(lst)) {
- obj = EVAL(CAR(lst), env);
- if (FALSEP(obj)) {
+ val = EVAL(CAR(lst), env);
+ if (FALSEP(val)) {
eval_state->ret_type = SCM_RETTYPE_AS_IS;
return SCM_FALSE;
}
}
- if (NULLP(CDR(lst)))
- return CAR(lst);
+ if (!NULLP(CDR(lst)))
+ SigScm_ErrorObj("and: improper argument list: ", lst);
- SigScm_ErrorObj("and: improper argument list: ", lst);
- return SCM_NULL;
+ return CAR(lst);
}
ScmObj ScmExp_or(ScmObj args, ScmEvalState *eval_state)
{
ScmObj env = eval_state->env;
ScmObj lst = args;
- ScmObj obj = SCM_FALSE;
+ ScmObj val = SCM_FALSE;
if (NULLP(lst))
return SCM_FALSE;
for (; CONSP(CDR(lst)); lst = CDR(lst)) {
- obj = EVAL(CAR(lst), env);
- if (NFALSEP(obj)) {
+ val = EVAL(CAR(lst), env);
+ if (NFALSEP(val)) {
eval_state->ret_type = SCM_RETTYPE_AS_IS;
- return obj;
+ return val;
}
}
- if (NULLP(CDR(lst)))
- return CAR(lst);
+ if (!NULLP(CDR(lst)))
+ SigScm_ErrorObj("or: improper argument list: ", lst);
- SigScm_ErrorObj("or: improper argument list: ", lst);
- return SCM_NULL;
+ return CAR(lst);
}
/*===========================================================================
More information about the uim-commit
mailing list