The #%plain-app identifier is just a renamed version of #%app from
'#%kernel, so it’s actually named #%app when initially defined. The
racket/base version of #%app exists to handle keyword arguments, so
racket/base exports the underlying version of #%app as #%plain-app. Of
course, fully expanded programs use the version from '#%kernel, not
racket/base, so the introduced #%app is not free-identifier=? to the one
from racket/base.

I’m not sure that there is a good solution to the unintuitive printing
behavior, given that this is a potential problem with any two
identifiers with the same symbolic name but different bindings. In
DrRacket, at least, you can expand the syntax object printed out and
click on #%app to see that its binding is the one from '#%kernel. If you
do the same with #%app from racket/base, you’ll see that it comes from
racket/private/kw instead.

> On Sep 28, 2016, at 16:05, 'William J. Bowman' via Racket Users 
> <[email protected]> wrote:
> 
> Consider the following program:
> 
>  #lang racket
>  (require (for-syntax syntax/parse))
> 
>  (define (Type x) x)
> 
>  (begin-for-syntax
>    (define x (local-expand #`(Type 1) 'expression null))
> 
>    (displayln x)
> 
>    (displayln
>     (syntax-parse x
>       #:literals (Type #%app #%plain-app)
>       [(#%app Type i)
>        1]
>       [(#%plain-app Type i)
>        2])))
> 
> Naturally, I expect it to print:
>  #<syntax:/tmp/test.rkt:7:28 (#%app Type (quote 1))>
>  1
> 
> But it doesn't:
>  #<syntax:/tmp/test.rkt:7:28 (#%app Type (quote 1))>
>  2
> 
> -- 
> William J. Bowman
> Northeastern University
> College of Computer and Information Science

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to