Re: [racket-users] namespace-variable-value thinks functions are bound to syntax

2017-10-31 Thread Junsong Li
#%28def._%28%28quote._~23~25kernel%29._dynamic-require%29%29 > > If the module exports _provided_ as syntax, > > then a use of the binding is expanded and > > evaluated in a fresh namespace to which > > the module is attached, which means that > > the module is vi

[racket-users] namespace-variable-value thinks functions are bound to syntax

2017-10-29 Thread Junsong Li
Hello list, In the following program, racket thinks foo2, and foo3 are bound to syntax. Is this expected behavior? -- File: go.rkt #lang racket (module p racket (provide (all-defined-out)) (define (foo0 a b) (+ a b)) (define (foo1 a b [c 3]) (+ a b c)) (define (foo2 a b [c 3] #

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

2017-10-29 Thread Junsong Li
e without > knowing what file it's in -- `namespace-require`, unlike `require`, is > a just a function and doesn't know anything about where it is in the > source code. So you need to use something like `(quote-module-path)` > that knows where it is. > > Sam > > On

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

2017-10-29 Thread Junsong Li
ocation) > > (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, 2017 at 12:19 P

[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) (

[racket-users] BSL expansion

2015-05-22 Thread Junsong Li
Hello list, I am wondering how to expand a BSL program into the Racket _core language_? Let's say a simple program: (define (id x) x) Thanks. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving em