[uim-commit] r2834 - branches/r5rs/sigscheme
yamaken at freedesktop.org
yamaken at freedesktop.org
Sat Jan 7 03:27:11 PST 2006
Author: yamaken
Date: 2006-01-07 03:27:07 -0800 (Sat, 07 Jan 2006)
New Revision: 2834
Modified:
branches/r5rs/sigscheme/syntax.c
Log:
* sigscheme/syntax.c
- (scm_s_letstar): Simplify
Modified: branches/r5rs/sigscheme/syntax.c
===================================================================
--- branches/r5rs/sigscheme/syntax.c 2006-01-07 08:03:02 UTC (rev 2833)
+++ branches/r5rs/sigscheme/syntax.c 2006-01-07 11:27:07 UTC (rev 2834)
@@ -717,14 +717,8 @@
...)
========================================================================*/
- if (!LISTP(bindings))
- ERR("let*: invalid bindings form");
-
- if (NULLP(bindings)) {
- env = scm_extend_environment(SCM_NULL, SCM_NULL, env);
- } else {
- for (; CONSP(bindings); bindings = CDR(bindings)) {
- binding = CAR(bindings);
+ if (CONSP(bindings)) {
+ FOR_EACH (binding, bindings) {
#if SCM_COMPAT_SIOD_BUGS
/* temporary solution. the inefficiency is not a problem */
if (LIST_1_P(binding))
@@ -732,19 +726,28 @@
#endif
if (!LIST_2_P(binding) || !SYMBOLP(var = CAR(binding)))
- ERR_OBJ("invalid binding form", binding);
+ goto err;
val = EVAL(CADR(binding), env);
/* extend env for each variable */
env = scm_extend_environment(LIST_1(var), LIST_1(val), env);
}
if (!NULLP(bindings))
- ERR_OBJ("invalid bindings form", bindings);
+ goto err;
+ } else if (NULLP(bindings)) {
+ env = scm_extend_environment(SCM_NULL, SCM_NULL, env);
+ } else {
+ goto err;
}
eval_state->env = env;
return scm_s_begin(body, eval_state);
+
+ err:
+ ERR_OBJ("invalid bindings form", bindings);
+ /* NOTREACHED */
+ return SCM_FALSE;
}
ScmObj
More information about the uim-commit
mailing list