[racket] Syntax arrows: Strange capturing behavior

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Sun Jan 4 09:51:04 EST 2015

This looks to me like something tricky that #lang web-server is doing.
Here's a simplified example:

#lang web-server
(define (f me)
  `((a . ,me)
    (r . ,me)
    , at me))


Perhaps someone (Jay?) can shed a little light on what transformations
#lang web-server is doing in this case and we can see if it needs to change
or if check syntax does.

My guess is that the second "me" is ending up in a binding position that
shadows the original binding of "me" and probably just rebinds it. Looking
at the expansion it isn't clear to me which one and whether or not there
are actually two of them (if there are, then the one that "looks wrong" to
check syntax can just be turned off somehow probably).

Robby



On Sun, Jan 4, 2015 at 1:18 AM, Jordan Johnson <jmj at fellowhuman.com> wrote:

> Hi all,
>
> This behavior (shown in attached images) showed up in some code I was
> working on tonight: A complex quasiquoted expression is apparently fooling
> DrRacket (6.1.1 under OS X Yosemite) into thinking one reference refers to
> another reference, not to its actual binding.
>
>
> (In the code pictured here, *oauth2-client* is a struct type defined in
> the file, and *me* refers to an instance of it. *me* was a constant that
> I was in the process of lifting to be a parameter.)
>
> If I replace the *,(oauth2-client-callback me)* with a different
> expression, the bottommost *me* is then correctly shown referring to the
> function parameter, but if I retype anything of the form *,(some-defined-function
> me)*, the odd behavior comes back. It persists across saving and
> reloading of the file.
>
> This seemed worthy of reporting, but after about 40 min of
> experimentation, I still haven’t managed to reproduce the behavior in
> another file, so I thought I’d best throw it out to the list to see if it
> triggers any ideas from someone with more knowledge of the syntax-checking
> internals.
>
> Cheers,
> Jordan
>
>
>
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20150104/62469c43/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2015-01-03 at 10.46.23 PM.png
Type: image/png
Size: 73637 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20150104/62469c43/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2015-01-03 at 10.46.45 PM.png
Type: image/png
Size: 60993 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20150104/62469c43/attachment-0003.png>

Posted on the users mailing list.