guile-devel
[Top][All Lists]
Advanced

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

Re: @bind


From: Neil Jerram
Subject: Re: @bind
Date: 07 Sep 2001 11:32:51 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

>>>>> "Marius" == Marius Vollmer <address@hidden> writes:

    Marius> Neil Jerram <address@hidden> writes:
    >> One detail: in the case where @bind creates a new variable on
    >> entry, should it destroy that variable on exit?

    Marius> I don't think it should go to that trouble.  The variable
    Marius> will have SCM_UNDEFINED as its value in that case which
    Marius> should be equivalent.

Well... `-)

address@hidden ~]$ guile -q
guile> cond
#<primitive-macro! cond>
guile> (@bind ((cond 3)) cond)
3
guile> cond
<unnamed port>: In expression cond:
<unnamed port>: Unbound variable: cond
ABORT: (unbound-variable)

Type "(backtrace)" to get more information or "(debug)" to enter the debugger.
guile> 

This is fixed by the patch below, but I don't know if it is the
best possible patch.

        Neil

Index: modules.c
===================================================================
RCS file: /cvs/guile/guile-core/libguile/modules.c,v
retrieving revision 1.33
diff -u -r1.33 modules.c
--- modules.c   2001/07/26 21:40:17     1.33
+++ modules.c   2001/09/07 10:32:14
@@ -278,7 +278,7 @@
 {
   /* 1. Check module obarray */
   SCM b = scm_hashq_ref (SCM_MODULE_OBARRAY (module), sym, SCM_UNDEFINED);
-  if (SCM_VARIABLEP (b))
+  if (SCM_VARIABLEP (b) && !SCM_UNBNDP (SCM_VARIABLE_REF (b)))
     return b;
   {
     SCM binder = SCM_MODULE_BINDER (module);




reply via email to

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