[racket-dev] require sub-forms
On Aug 25, Jay McCarthy wrote:
> On Tue, Aug 24, 2010 at 10:18 PM, Eli Barzilay <eli at barzilay.org> wrote:
> > On Aug 24, Jay McCarthy wrote:
> >> There is not now but we could make a module that only exported them
> >> so you could provide all-from-out it and thus centralize the list of
> >> subforms. That's the cleanest idea I have.
> >
> > This assumes you want only the core ones, and not things that are
> > defined in other libraries (like in `racket/require').
> >
> >
> >> (You don't want to hear my really bad ideas)
> >
> > (#rx"-in$" ?)
> >
>
> That's not my bad idea, which might not be so bad actually. I'm
> imagine a new require/provide transformer that names sets of exports:
>
> .... in require/provide.rkt :
>
> (define-export-set require-sub-forms only-in except-in ...)
> (define-export-set provide-sub-forms all-defined-out all-from-out ...)
> ; These expand to static information
> [...]
But it won't be a solution to the problem, because these definitions
would appear in a place that is not where they were made -- so when a
new form is added to the core language, someone needs to remember to
update these export sets wherever they're defined. So it looks much
better to me to put the sets where the forms are defined -- but that's
practically the same as your earlier suggestion to organize the code
so that the bindings all conveniently come from a single module.
(My other guess was something like `filtered-out' that checks the
bindings and filters only those that have a value that is the right
kind of transformer -- but I'm not sure that this can work.)
--
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
http://barzilay.org/ Maze is Life!