Re: [racket-users] Why do single-form modules behave differently?

2021-01-03 Thread Sage Gerard
Fantastic, thank you ~slg ‐‐‐ Original Message ‐‐‐ On Sunday, January 3, 2021 12:14 PM, Ryan Culpepper wrote: > It's the consequence of two design goals: > > 1. The `module` form is separate from the `#%module-begin` syntax hook so > that the module's initial language can pick the

Re: [racket-users] Why do single-form modules behave differently?

2021-01-03 Thread Ryan Culpepper
It's the consequence of two design goals: 1. The `module` form is separate from the `#%module-begin` syntax hook so that the module's initial language can pick the hook macro that controls the entire module body. 2. Racket's primitive syntax is designed so that it can be re-expanded. (The

Re: [racket-users] Why do single-form modules behave differently?

2021-01-02 Thread Michael MacLeod
Oops, sorry about interpreting your question wrong. Unfortunately I don't know the answer to your actual question. On Sat, Jan 2, 2021, 10:24 PM Sage Gerard wrote: > I know about that. I asked why it was designed that way. > > > Sent from ProtonMail mobile > > > > Original Message

Re: [racket-users] Why do single-form modules behave differently?

2021-01-02 Thread Sage Gerard
I know about that. I asked why it was designed that way. Sent from ProtonMail mobile Original Message On Jan 3, 2021, 12:18 AM, Michael MacLeod wrote: > There's an edge case of 'module' when only one form is provided which results > in that form being partially expanded to

Re: [racket-users] Why do single-form modules behave differently?

2021-01-02 Thread Michael MacLeod
There's an edge case of 'module' when only one form is provided which results in that form being partially expanded to determine if such expansion would lead to a #%plain-module-begin form. Otherwise (more than one form provided) they are wrapped in #%module-begin with no partial expansion

[racket-users] Why do single-form modules behave differently?

2021-01-02 Thread Sage Gerard
Why does Racket handle modules with exactly one form differently? I ran into a bug where modules in my module language won't expand if the modules have exactly one form, so I'm just curious. (Wild guess: It's Racket's way of checking for a shortcut to end expansion earlier) ~slg -- You