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 corresponds to the label

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 I would like it to match

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

2015-12-16 Thread Leif Andersen
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 I would like it to match on all phases? ~Leif Andersen On Wed, Dec 16, 2015 at 10:02 PM, Stephen Chang wrote: > There's a #:phase option available when

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

2015-12-16 Thread Stephen Chang
There's a #:phase option available when specifying literals: http://docs.racket-lang.org/syntax/Parsing_Syntax.html?q=syntax-parse#%28form._%28%28lib._syntax%2Fparse..rkt%29._syntax-parse%29%29 On Wed, Dec 16, 2015 at 9:55 PM, Leif Andersen wrote: > Okay, that makes sense, thanks. > > So out of

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

2015-12-16 Thread Leif Andersen
Okay, that makes sense, thanks. So out of curiosity, when doing a `syntax-parse`, is there any way I can pass in phase level 1 quote as a literal? ~Leif Andersen On Wed, Dec 16, 2015 at 6:44 PM, Sam Tobin-Hochstadt wrote: > That depends on what you're trying to do, but probably not. Going unde

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 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 phase-1 > bindings. When

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

[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: #'(begin-for-sy