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

Re: [Scheme-reports] Toplevel import scoping



On Sun, Apr 24, 2011 at 11:02 AM, Andre van Tonder <andre@x> 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@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports