Re: [Scheme-reports] Toplevel import scoping
Alex Shinn 24 Apr 2011 02:42 UTC
On Sun, Apr 24, 2011 at 11:02 AM, Andre van Tonder <andre@het.brown.edu> wrote:
> What does the following program print? In other words, what does IMPORT do
> when redefining existing bindings?
>
> (module (foo)
> (export (x)
> (begin
> (define x 1)))
>
> TOPLEVEL:
>
> (define x 0)
> (define (get-x) x)
> (import (foo))
> (display x) ==> 1
> (display (get-x)) ==> WHICH WILL IT BE?
This is unspecified, and should probably be
an error in a program, but in the repl I think
implementations vary too greatly to standardize
this.
--
Alex
_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports