Re: [racket-users] whither `splicing-parameterize`? or am I doing it wrong?

2018-01-25 Thread Alexis King
> On Jan 25, 2018, at 16:45, Robby Findler > wrote: > > Isn't the last form already required to not be a definition? In that example, yes, but not always, and splicing-parameterize can’t be sure one way or the other. In this example, containing exclusively

Re: [racket-users] whither `splicing-parameterize`? or am I doing it wrong?

2018-01-25 Thread Robby Findler
Isn't the last form already required to not be a definition? Robby On Thu, Jan 25, 2018 at 5:59 PM Alexis King wrote: > > On Jan 24, 2018, at 12:57 AM, Ryan Culpepper > > wrote: > > > > It might make sense to `(set! new-parameterization #f)` at the

Re: [racket-users] whither `splicing-parameterize`? or am I doing it wrong?

2018-01-25 Thread Alexis King
> On Jan 24, 2018, at 12:57 AM, Ryan Culpepper > wrote: > > It might make sense to `(set! new-parameterization #f)` at the end so > that the parameterization (and the values it holds) can be GC'd sooner > when splicing-parameterize is used at top level or module level. The

Re: [racket-users] whither `splicing-parameterize`? or am I doing it wrong?

2018-01-24 Thread Ryan Culpepper
It might make sense to `(set! new-parameterization #f)` at the end so that the parameterization (and the values it holds) can be GC'd sooner when splicing-parameterize is used at top level or module level. Ryan On 1/24/18 6:00 AM, Alexis King wrote: Here is an implementation of a version of

Re: [racket-users] whither `splicing-parameterize`? or am I doing it wrong?

2018-01-23 Thread Alexis King
Here is an implementation of a version of splicing-parameterize that uses local-expand, a la other forms in racket/splicing: #lang racket (require (for-syntax syntax/kerncase) (for-meta 2 racket/base) syntax/parse/define) (begin-for-syntax

Re: [racket-users] whither `splicing-parameterize`? or am I doing it wrong?

2018-01-23 Thread Matthias Felleisen
You want to head expand not just look at the raw words, because an expression can expand to (define-values (x …) …). You may wish to look at how modules, units, and classes are expanded — Matthias > On Jan 23, 2018, at 8:15 PM, Matthew Butterick wrote: > > >> On Jan 22,

Re: [racket-users] whither `splicing-parameterize`? or am I doing it wrong?

2018-01-23 Thread Matthew Flatt
If you want `splicing-parameterize` to compose with other macros that might implement definition forms, there's no fixed set of definition forms. The other splicing forms use `local-expand` to detect definition forms, since the small set of core definition forms can be reliably detected in

Re: [racket-users] whither `splicing-parameterize`? or am I doing it wrong?

2018-01-23 Thread Matthew Butterick
> On Jan 22, 2018, at 7:22 PM, Matthew Flatt wrote: > > I think I've never considered `splicing-parameterize` because > parameters can be mutated, but a `splicing-parameterize` form does make > sense. I imagine that it would be implemented by creating a > parameterization

Re: [racket-users] whither `splicing-parameterize`? or am I doing it wrong?

2018-01-22 Thread Matthew Flatt
At Sun, 21 Jan 2018 17:43:04 -0500, Matthew Butterick wrote: > I have a macro that produces code for a module expression, roughly like so: > > #'(module mod racket/base > . BODY-EXPRS) > > I'd like to `parameterize` the BODY-EXPRS as a group, roughly like so: > > #'(module mod racket/base

[racket-users] whither `splicing-parameterize`? or am I doing it wrong?

2018-01-21 Thread Matthew Butterick
I have a macro that produces code for a module expression, roughly like so: #'(module mod racket/base . BODY-EXPRS) I'd like to `parameterize` the BODY-EXPRS as a group, roughly like so: #'(module mod racket/base (parameterize ([param val]) . BODY-EXPRS)) But — my BODY-EXPRS