This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Unbinding root definitions which hide definitions of a module


Greg Badros <gjb@cs.washington.edu> writes:

> Suppose I have a:
> 
> (define foo 1)
> 
> in a module.
> 
> and I later do a:
> 
> (define foo 2)
> 
> in the-root-module.
> 
> Is there any way to undo the definition in the-root-module to permit the 
> definition of foo in the other module to be visible?  undefine does not
> seem to do this, and I'm not sure if I'm wrong to expect that it would.
> (It could just be that I'm working too late! :-) ).


(define-module (a))
(define foo 1)
(export foo)

(define-module (b))
(use-modules (a))
(define foo (+ foo 1))

foo -> 2
(undefine foo)
foo -> 1


Unfortunately this doesn't work in the current module implementation.



Jost

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]