Re: [racket-users] Namespaces and modules

2020-11-12 Thread Matthew Flatt
At Thu, 12 Nov 2020 23:35:11 +0100, Dominik Pantůček wrote: > If I however try to achieve the same goal using module form within my > module, it always fails: > > (module sandbox racket/base > (provide #%app #%datum test) > (define (test) (displayln 'test))) > (parameterize

[racket-users] Namespaces and modules

2020-11-12 Thread Dominik Pantůček
Hello Racketeers, it seemed to me that writing a data format for my project by simply introducing a new syntax forms and then just eval'uating the file (maybe eval-syntax) was a great idea. I've done things like that many times but my initial bindings were always in a separate file. Like:

Re: [racket-users] Macros expanding to require forms

2020-11-12 Thread Veit Heller
Hello, This is very useful information, thank you! I still have trouble understanding _why_ this works, though; I guess I’m a little confused as to how the scope-flipping influences things. For instance, I don’t quite understand why the example from the docs works, but if you define the

Re: [racket-users] Macros expanding to require forms

2020-11-12 Thread Sorawee Porncharoenwase
See https://docs.racket-lang.org/reference/stxtrans.html#%28def._%28%28quote._~23~25kernel%29._syntax-local-introduce%29%29 for an example program that requires a library via a macro. On Thu, Nov 12, 2020 at 3:09 AM Veit Heller wrote: > > Hello, > > I’m suspecting I’m getting a little turned

[racket-users] Macros expanding to require forms

2020-11-12 Thread Veit Heller
Hello, I’m suspecting I’m getting a little turned around by phase levels and where `require` comes in: it seems to be impossible to write a macro that expands to a valid `require` (it doesn’t throw an error, but the functions aren’t defined either). What am I missing? At what phase level does