<div dir="ltr">Do you mind expanding on what MTWT stands for? I'm not familiar with this paper and am curious.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, May 8, 2014 at 6:20 PM, John Clements <span dir="ltr"><<a href="mailto:clements@brinckerhoff.org" target="_blank">clements@brinckerhoff.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=""><br>
On May 8, 2014, at 3:00 PM, Ryan Culpepper <<a href="mailto:ryanc@ccs.neu.edu">ryanc@ccs.neu.edu</a>> wrote:<br>
<br>
> IIRC, the typesetting of environment extension might suggest replacement in a mapping, but I believe it actually means 'cons' in an association list, and 'nostops' is one thing that relies on the latter implementation of the environment rather than the former.<br>
<br>
</div>Ah… so the model does in fact have the “uncovering” behavior I expected it to. In this case, I think that the text of the paper is mistaken; it says<br>
<br>
nostops[xi] = {var -> transform | xi(var) = transform and transform != STOP }<br>
<br>
which certainly suggests to me that these mappings simply wouldn’t appear in the updated mapping.<br>
<br>
Amazing how ambiguous formal syntax can be.<br>
<br>
It seems like the right way to fix this would be to explicitly separate the environment xi into a mapping and a stop list—the ‘nostops’ definition would be trivial, but lookup in xi would get slightly uglier. Perhaps a footnote somewhere in the paper?<br>
<br>
Anyway, thanks for clarifying.<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
John<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
><br>
> So an environment with 'lambda' in the stop list actually looks like<br>
><br>
> ((lambda STOP) (lambda FUN))<br>
><br>
> so when 'nostops' filters it, it produces<br>
><br>
> ((lambda FUN))<br>
><br>
> and the previous meaning of 'lambda' is restored.<br>
><br>
> Ryan<br>
><br>
><br>
> On 05/08/2014 04:58 PM, John Clements wrote:<br>
>> I’m reading through MTWT for the nth time, and this time I have a question about the ‘nostops’ metafunction, part of local expansion.<br>
>><br>
>> Specifically: ‘nostops’ takes an environment xi, and strips out everything bound to 'STOP’. This prevents the ’STOP’s from an enclosing local expand from being in force in this one. However, it seems to me that the ’nostops’ metafunction should restore the bindings that were in place before they were mapped to STOP. More specifically; suppose a local-expand specifies, say, ‘lambda’ as a STOP. This replaces the mapping from ‘lambda’ to FUN with a mapping from ‘lambda’ to ’STOP’. Then, a nested local-expand uses a different stop-list, that doesn’t include ‘lambda’. If I’m reading the paper correctly, this local expansion would then take place in a ‘xi’ where there was no binding for lambda at *all*, which would presumably lead to an error during that expansion.<br>
>><br>
>> I checked out the model, to see if this was a typesetting issue, but it seems pretty clear to me that the model linked to by the paper has exactly this property; it’s simply filtering the ‘xi’ environment to throw out things that were bound to STOP.<br>
>><br>
>> I tried to construct a racket program to illustrate my question, and here’s what I came up with:<br>
>><br>
>> #lang racket<br>
>><br>
>> (let-syntax ([boring (lambda (stx) (cadr (syntax->list stx)))])<br>
>><br>
>> (let-syntax ([a (lambda (stx)<br>
>> (local-expand (cadr (syntax->list stx))<br>
>> 'expression<br>
>> (list #'boring)))])<br>
>> (let-syntax ([b (lambda (stx)<br>
>> (local-expand (cadr (syntax->list stx))<br>
>> 'expression<br>
>> (list)))])<br>
>> (a (b (boring 34))))))<br>
>><br>
>> Unsurprisingly, this evaluated to the “correct” value, 34. This means that either the model doesn’t match Racket, or (more likely) I’m misunderstanding the model. Or possibl<br>
>><br>
>> Ah, what the heck; I’ll cc: the whole racket list. I’ll take help wherever I can get it :).<br>
>><br>
>> John<br>
>><br>
><br>
<br>
<br>
____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
</div></div></blockquote></div><br></div>