This is the mail archive of the
guile@sources.redhat.com
mailing list for the Guile project.
Re: variable binding
- To: Keisuke Nishida <kxn30 at po dot cwru dot edu>
- Subject: Re: variable binding
- From: Jost Boekemeier <jostobfe at linux dot zrz dot TU-Berlin dot DE>
- Date: 24 Aug 2000 18:00:14 +0200
- Cc: guile at sourceware dot cygnus dot com
- References: <m3lmxn9rvi.fsf@indy.STUDENT.CWRU.Edu>
Keisuke Nishida <kxn30@po.cwru.edu> writes:
> % guile -q
> guile> (define (foo) (+ 1 2))
> guile> (foo)
> 3
> guile> (define + -)
> guile> (foo)
> 3
That's certainly a bug in the new guile sources. `+'
and `-' are procedures, not syntax.
user/guile> (define (foo) (+ 1 2))
user/guile> (foo)
3
user/guile> (define + -)
user/guile> (foo)
-1
user/guile>
> How should `define' work with modules, and when should bindings be
> resolved?
I don't think the above problem has anything to do with the module
system, it might be a problem with the memoizer. Just look at
the source. :)
> I guess this is because `define' creates a new binding in a module
> when first called, then it works same as `set!'
Heaven, no -- Even a module system for scheme must respect RnRS. :)
That means that define must shadow an imported binding.
Jost