[racket-users] begin-for-syntax causes syntax objects to expand to a different #'quote

2015-12-16 Thread Leif Andersen
Hello, I am finding that when I have a syntax object: #'(begin-for-syntax (define-values (x) 5), when I expand it it becomes: #'(begin-for-syntax (define-values (x) '5). However, the quote in that expansion will not be free-identifier=? to the one if I were to type it out by hand:

Re: [racket-users] begin-for-syntax causes syntax objects to expand to a different #'quote

2015-12-16 Thread Sam Tobin-Hochstadt
That depends on what you're trying to do, but probably not. Going under a `quote-syntax` doesn't change things, it's just that those identifiers are usually used in a macro somewhere else. But it would depend on your application. Note the handling of submodules, though, in particular the call to

Re: [racket-users] begin-for-syntax causes syntax objects to expand to a different #'quote

2015-12-16 Thread Sam Tobin-Hochstadt
The identifiers are the same, but only when comparing their phase-1 bindings. When doing traversal of syntax objects, you need to keep track of the phase that identifiers are meaningful at. Here's a version of your paste comparing at the right phase: http://pasterack.org/pastes/95574 Here's some

Re: [racket-users] begin-for-syntax causes syntax objects to expand to a different #'quote

2015-12-16 Thread Leif Andersen
Ah, cool. Thanks. Does that also mean that if I see a `syntax` form inside of a `begin-for-syntax` it goes back to phase 0? Thanks. ~Leif Andersen On Wed, Dec 16, 2015 at 6:25 PM, Sam Tobin-Hochstadt wrote: > The identifiers are the same, but only when comparing their

Re: [racket-users] begin-for-syntax causes syntax objects to expand to a different #'quote

2015-12-16 Thread Stephen Chang
I'm not sure. I would guess that it corresponds to the label phase? On Wed, Dec 16, 2015 at 10:37 PM, Leif Andersen wrote: > Ah, okay, thanks. One question, I notice that you can pass in #f to > #:phase, I presume that is similar to for-label, can I use that to > indicate

Re: [racket-users] begin-for-syntax causes syntax objects to expand to a different #'quote

2015-12-16 Thread Leif Andersen
Yeah, I would guess that too. Anyway, it doesn't seem to do all phases. So I just shift the phase down every time I see a begin-for-syntax. Thanks for your help. ~Leif Andersen On Wed, Dec 16, 2015 at 10:52 PM, Stephen Chang wrote: > I'm not sure. I would guess that it