[racket-dev] RFC: "provide" via mutation

From: Sam Tobin-Hochstadt (samth at ccs.neu.edu)
Date: Mon Jun 21 16:10:20 EDT 2010

On Mon, Jun 21, 2010 at 4:06 PM, Matthias Felleisen
<matthias at ccs.neu.edu> wrote:
> Stupid me.  REQUIRING is done by DEMAND (as in NEED). So the strange thing is that you gain access to a module local identifier via the store. I still sense something is wrong with the store phases.

No, that's not right.  `require' is always executed, it's not driven
by demand.  That's why the `require' of 'm happens, even though
there's no references to any exports of 'm.  Perhaps what you mean is
that only modules that are `require'd are invoked in any particular
store. The trick is that the original expansion of 'm is in a
different store than 'n, which is why the `require' is needed. But the
store is still the key.

> On Jun 21, 2010, at 4:01 PM, Sam Tobin-Hochstadt wrote:
>> On Mon, Jun 21, 2010 at 3:58 PM, Matthias Felleisen
>> <matthias at ccs.neu.edu> wrote:
>>> I still don't understand how the #'x reference is actually exported from m to n. I understand the store part but why is the for-value require of 'm needed? If you remove it you get a type-checking error (add1 applied to False).
>> If you don't have the `require' of 'm, then the box is never mutated
>> in the store of the expansion time of 'n, leaving it with the initial
>> value #f. The `begin-for-syntax' in 'm is what does the exporting, by
>> mutating the shared box.
>> --
>> sam th
>> samth at ccs.neu.edu

sam th
samth at ccs.neu.edu

Posted on the dev mailing list.