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-syntax (define-values (x) '5), and expand that.

If however, I have a `begin` rather than a `begin-for-syntax`, giving me:
#'(begin (define-values (x) 5) it works as expected. (The quote it
expands into is free-identifier=? to the one that I am using.)

I am calling expand (or expand-syntax) directly, and not really using
any phase levels outside of whatever `expand` may use.

Here is my code: http://pasterack.org/pastes/78711

#lang racket

(define x (expand #'(begin-for-syntax
                      (define-values (x) '5))))
(define y (expand #'(begin-for-syntax
                      (define-values (x) 5))))

(define (ident=? stx)
  (syntax-case stx ()
    [(_ (_ (_) (var _)))
     (free-identifier=? #'var #'quote)]))

(syntax->datum x)
(syntax->datum y)
(ident=? x)
(ident=? y)

Is this expected behavior? If so, can you give me some intuition as to why?

Thank you.

~Leif Andersen

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to