guile-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

guile/guile-core/libguile eval.c


From: Marius Vollmer
Subject: guile/guile-core/libguile eval.c
Date: Sat, 13 Oct 2001 11:41:13 -0400

CVSROOT:        /cvs
Module name:    guile
Changes by:     Marius Vollmer <address@hidden> 01/10/13 11:41:12

Modified files:
        guile-core/libguile: eval.c 

Log message:
        (scm_m_atbind): First try to find the variable without defining it
        locally; when it has not been found, define it locally.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/libguile/eval.c.diff?cvsroot=OldCVS&tr1=1.241&tr2=1.242&r1=text&r2=text

Patches:
Index: guile/guile-core/libguile/eval.c
diff -u guile/guile-core/libguile/eval.c:1.241 
guile/guile-core/libguile/eval.c:1.242
--- guile/guile-core/libguile/eval.c:1.241      Fri Aug 31 10:42:31 2001
+++ guile/guile-core/libguile/eval.c    Sat Oct 13 11:41:12 2001
@@ -1135,7 +1135,7 @@
 {
   SCM x = SCM_CDR (xorig);
   SCM top_level = scm_env_top_level (env);
-  SCM vars = SCM_EOL;
+  SCM vars = SCM_EOL, var;
   SCM exps = SCM_EOL;
 
   SCM_ASSYNT (scm_ilength (x) > 1, scm_s_expression, s_atbind);
@@ -1151,8 +1151,12 @@
       for (rest = x; SCM_NIMP (rest); rest = SCM_CDR (rest))
        if (SCM_EQ_P (SCM_CAR (sym_exp), SCM_CAR (SCM_CAR (rest))))
          scm_misc_error (s_atbind, scm_s_duplicate_bindings, SCM_EOL);
-      vars = scm_cons (scm_sym2var (SCM_CAR (sym_exp), top_level, SCM_BOOL_T),
-                      vars);
+      /* The first call to scm_sym2var will look beyond the current
+        module, while the second call wont. */
+      var = scm_sym2var (SCM_CAR (sym_exp), top_level, SCM_BOOL_F);
+      if (SCM_FALSEP (var))
+       var = scm_sym2var (SCM_CAR (sym_exp), top_level, SCM_BOOL_T);
+      vars = scm_cons (var, vars);
       exps = scm_cons (SCM_CADR (sym_exp), exps);
     }
   return scm_cons (SCM_IM_BIND,



reply via email to

[Prev in Thread] Current Thread [Next in Thread]