Re: [racket-users] namespace-require a submodule

2017-10-29 Thread Junsong Li
That explains. Thanks! On Sun, Oct 29, 2017 at 11:20 AM, Sam Tobin-Hochstadt wrote: > If you look at what `(quote-module-path food)` produces, it's just > `(submod "/path/to/go.rkt" food)`. The issue is just that > `namespace-require` needs a reference that it can resolve without > knowing what f

Re: [racket-users] namespace-require a submodule

2017-10-29 Thread Sam Tobin-Hochstadt
If you look at what `(quote-module-path food)` produces, it's just `(submod "/path/to/go.rkt" food)`. The issue is just that `namespace-require` needs a reference that it can resolve without knowing what file it's in -- `namespace-require`, unlike `require`, is a just a function and doesn't know an

Re: [racket-users] namespace-require a submodule

2017-10-29 Thread Junsong Li
Thanks! That works. I am still not sure what is the thing that I don't know. Why do we need a compile-time reference here? On Sun, Oct 29, 2017 at 9:59 AM, Sam Tobin-Hochstadt wrote: > I think you want to use `quote-module-path` here: > > #lang racket > > (require syntax/location) > > (module f

Re: [racket-users] namespace-require a submodule

2017-10-29 Thread Sam Tobin-Hochstadt
I think you want to use `quote-module-path` here: #lang racket (require syntax/location) (module food racket (provide apple) (define apple "pie")) (parameterize ([current-namespace (make-base-namespace)]) (namespace-require (quote-module-path food)) (eval 'apple)) On Sun, Oct 29, 2

[racket-users] namespace-require a submodule

2017-10-29 Thread Junsong Li
Hello list, I am trying to do namespace-require to a submodule, racket complains about unknown module, as below: $ cat go.rkt #lang racket (module food racket (provide apple) (define apple "pie")) (parameterize ([current-namespace (make-base-namespace)]) (namespace-require ''food) (