Hi,

It seems that after an identifier has been shifted 
by syntax-shift-phase-level, the original identifier can bind the shifted 
identifier, but not the other way around. I think the correct behavior is 
that neither should bind the other. The following code can be used to test 
this.

(define-syntax bind-test0

  (lambda (stx)

    (define id #'x)

    (define shifted-id (syntax-shift-phase-level id -1))

    (syntax-case stx ()

      [(_ e)

        #`(let ([#,id e])

             (displayln #,shifted-id))])))


(define-syntax bind-test1

  (lambda (stx)

    (define id #'x)

    (define shifted-id (syntax-shift-phase-level id -1))

    (syntax-case stx ()

      [(_ e)

        #`(let ([#,shifted-id e])

             (displayln #,id))])))


(bind-test0 100) would display 100, but (bind-test1 100) would raise an 
error. I'm new to Racket, so if this is in fact the correct behavior, a 
pointer to some related documentation would be appreciated.


Thanks,

Yongming


-- 
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 racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/c9d47c4f-0834-4c7a-99cf-17d55201c390%40googlegroups.com.

Reply via email to