[racket-dev] require sub-forms

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Wed Aug 25 10:43:30 EDT 2010

On Wed, Aug 25, 2010 at 8:18 AM, Eli Barzilay <eli at barzilay.org> wrote:
> 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.)

I agree that it's basically the same when done right, which is why I
initially suggested the simpler solution. I think the one benefit of
these "export sets" is that they make it a language abstraction rather
than a convention of where to put files.

Jay

-- 
Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University
http://teammccarthy.org/jay

"The glory of God is Intelligence" - D&C 93


Posted on the dev mailing list.