[uim-commit] r2831 - branches/r5rs/sigscheme

yamaken at freedesktop.org yamaken at freedesktop.org
Fri Jan 6 22:19:08 PST 2006


Author: yamaken
Date: 2006-01-06 22:19:05 -0800 (Fri, 06 Jan 2006)
New Revision: 2831

Modified:
   branches/r5rs/sigscheme/syntax.c
Log:
* sigscheme/syntax.c
  - (scm_s_letstar): Fix lacking environment extension when bindings
    is null


Modified: branches/r5rs/sigscheme/syntax.c
===================================================================
--- branches/r5rs/sigscheme/syntax.c	2006-01-07 05:11:50 UTC (rev 2830)
+++ branches/r5rs/sigscheme/syntax.c	2006-01-07 06:19:05 UTC (rev 2831)
@@ -721,25 +721,28 @@
     if (!LISTP(bindings))
         ERR("let*: invalid bindings form");
 
-    for (; CONSP(bindings); bindings = CDR(bindings)) {
-        binding = CAR(bindings);
+    if (NULLP(bindings)) {
+        env = scm_extend_environment(SCM_NULL, SCM_NULL, env);
+    } else {
+        for (; CONSP(bindings); bindings = CDR(bindings)) {
+            binding = CAR(bindings);
 #if SCM_COMPAT_SIOD_BUGS
-        /* temporary solution. the inefficiency is not a problem */
-        if (LIST_1_P(binding))
-            binding = LIST_2(CAR(binding), SCM_FALSE);
+            /* temporary solution. the inefficiency is not a problem */
+            if (LIST_1_P(binding))
+                binding = LIST_2(CAR(binding), SCM_FALSE);
 #endif
 
-        if (!LIST_2_P(binding) || !SYMBOLP(var = CAR(binding)))
-            ERR_OBJ("invalid binding form", binding);
-        val = EVAL(CADR(binding), env);
+            if (!LIST_2_P(binding) || !SYMBOLP(var = CAR(binding)))
+                ERR_OBJ("invalid binding form", binding);
+            val = EVAL(CADR(binding), env);
 
-        /* extend env for each variable */
-        env = scm_extend_environment(LIST_1(var), LIST_1(val), 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);
     }
 
-    if (!NULLP(bindings))
-        ERR_OBJ("invalid bindings form", bindings);
-
     eval_state->env = env;
 
     return scm_s_begin(body, eval_state);



More information about the uim-commit mailing list