Wow, sorry for the auto correct fail in my earlier message! ("is" => "id" and "sucks" => "a").<div><br></div><div>Robby<br><br>On Thursday, May 15, 2014, Matthias Felleisen <<a href="mailto:matthias@ccs.neu.edu">matthias@ccs.neu.edu</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><br></div><div>Yes, being forced to use 'stx' as context is suspicious, too. It injects the identifier into the scope and a program may accidentally see it then. </div>
<div><br></div><div><br></div><br><div><div>On May 15, 2014, at 7:20 PM, Robby Findler wrote:</div><br><blockquote type="cite">We have a work around. (In the larger program there is one is that comes from the input and one that doesn't. We can just bind it to a pair instead.)<div>
<br></div><div>This program seems quite suspicious. I can't quite bring myself to call it a bug because it is sucks widely used part of things tho!</div>
<div><br></div><div>Robby</div><div><br>On Thursday, May 15, 2014, Matthias Felleisen <<a>matthias@ccs.neu.edu</a>> wrote:<br><blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word"><div><br></div><div><br></div><div><div style="font-family:monospace">On May 15, 2014, at 5:56 PM, Robby Findler wrote:</div><span style="font-family:monospace"><br></span><blockquote type="cite" style="font-family:monospace">

<span style="border-collapse:separate;font-family:'Lucida Grande';font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium"><span style="font-family:monospace">How does this help us understand the original, strange program?</span></span></blockquote>

</div><div><span style="border-collapse:separate;font-family:'Lucida Grande';font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium"><span style="font-family:monospace"><br>

</span></span></div><div><font face="monospace">I am providing a work-around because I recognize the idiom. </font></div><div><font face="monospace">I can't explain the original. </font></div><div><font face="monospace"><br>

</font></div><div><font face="monospace"><br></font></div><div><br></div><div><div>On May 15, 2014, at 6:23 PM, Spencer Florence wrote:</div><br><blockquote type="cite"><div dir="ltr">I'm not sure how gensym fixes this:<br>

</div></blockquote><div><br></div><div><br></div><div><div>Not #f, stx: </div><div><br></div><div><div>(define-syntax (make-funny-set! stx)</div><div>  (syntax-parse stx</div><div>    [(_ v) #`(define #,(begin (set! funny (datum->syntax stx (gensym))) funny) v)]))</div>

</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div><div><br></div><br><blockquote type="cite"><div dir="ltr">
<br>
<div>#lang racket</div><div><br></div><div>(require (for-syntax syntax/parse racket/syntax racket/format))</div><div><br></div><div>(define-for-syntax funny #f)</div>
<div><br></div><div>(define-syntax (make-funny-set! stx)</div><div>  (syntax-parse stx</div><div>    [(_ v) #`(define #,(begin (set! funny (datum->syntax #f (gensym))) funny) v)]))</div><div><br></div><div>(define-syntax (funny-ref stx)</div>


<div>  (syntax-parse stx</div><div>    [(_) funny]))</div><div><br></div><div>(define-syntax (funny-set! stx)</div><div>  (syntax-parse stx</div><div>    [(_ v) #`(set! #,funny v)]))</div><div><br></div><div>(make-funny-set! 2)</div>


<div>(void (void (void (funny-set! 3))))</div><div>(funny-ref)<br><br>errors with:<br><br><div>  g27591: unbound identifier;</div><div>   also, no #%top syntax transformer is bound in: g27591<br><br>regardless of how many calls to void there are (inclusive of 0). This makes sense, as the syntax marks don't add up. The calls to "syntax-local-introduce" in the original program aught to solve this, but as we saw... `/me points to robby's email`<br>


<br><br><br>And removing the datum->syntax errors with:<br><br><div>  funny-ref: received value from syntax expander was not syntax</div><div>    received: 'g27876<br><br>Which also makes sense: a symbol is not Syntax.<br>


<br><br></div></div></div></div><div><br><br><div>On Thu, May 15, 2014 at 4:56 PM, Robby Findler <span dir="ltr"><<a>robby@eecs.northwestern.edu</a>></span> wrote:<br>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">How does this help us understand the original, strange program?<br>
<br>
Robby<br>
<br>
On Thu, May 15, 2014 at 4:51 PM, Matthias Felleisen<br>
<div><div><<a>matthias@ccs.neu.edu</a>> wrote:<br>
><br>
> Then use gensym instead of g and "~a" instead.<br>
><br>
><br>
><br>
> On May 15, 2014, at 5:38 PM, Matthias Felleisen <<a>matthias@ccs.neu.edu</a>> wrote:<br>
><br>
>><br>
>> Did you want this:<br>
>><br>
>> #lang racket<br>
>><br>
>> (require (for-syntax syntax/parse racket/syntax))<br>
>><br>
>> (define-for-syntax funny #f)<br>
>><br>
>> (define-syntax (make-funny-set! stx)<br>
>>  (syntax-parse stx<br>
>>    [(_ v) #`(define #,(begin (set! funny (form</div></div></blockquote></div></div></blockquote></div></div></blockquote></div></blockquote></div></div></blockquote></div>