> On Nov 30, 2018, at 08:23, Sam Tobin-Hochstadt <sa...@cs.indiana.edu> wrote:
> I'm not sure why `-e` doesn't evaluate in the same namespace as the
> REPL, but if you put `(enter! "my-file.rkt")` in `enter.rktl` then:

I’m curious about this, too. At first I thought it was just a misfeature, not 
necessarily a bug, but now I’m not so sure. The namespaces are not actually 
separate, as the following interaction demonstrates:

    $ racket -ie '(define x 3)'
    Welcome to Racket v7.1.0.1.
    > x

So then what gives? After further experimentation, my running theory is that 
any mutation of `current-namespace` inside of -e is reverted when the REPL 
starts up. You can see this by skipping `enter!` completely and just modifying 
`current-namespace` directly:

    $ racket -ie '(define ns (make-base-namespace)) (current-namespace ns)'
    Welcome to Racket v7.1.0.1.
    > (eq? ns (current-namespace))

I don’t know if this is intentional behavior or just a bug.


You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to