I think the case here is a little subtle. The syntax object #'(define x y) has actually gone through expansion, but Racket's new expansion model will prune this syntax object's local scopes . One could use #:local  in this case to see the difference:
> (syntax-parse (let ([define 'something-else]) (quote-syntax (define x y))) [((~literal define) var:id e:expr) 'yes] [_ 'no]) 'yes > (syntax-parse (let ([define 'something-else]) (quote-syntax (define x y) > #:local)) [((~literal define) var:id e:expr) 'yes] [_ 'no]) 'no The original doc predates the new expander and the result was probably 'no in the old expansion model. Best, Shu-Hung 1. http://www.cs.utah.edu/plt/scope-sets/general-macros.html#%28part._.Local_.Bindings_and_.Syntax_.Quoting%29 2. https://docs.racket-lang.org/reference/Syntax_Quoting__quote-syntax.html On Thu, Aug 3, 2017 at 1:53 PM, Jordan Johnson <j...@fellowhuman.com> wrote: > On Aug 1, 2017, at 11:34, Jens Axel Søgaard <jensa...@soegaard.net> wrote: > > The binding information is attached a syntax object during expansion. > In your example the #'(define x y) haven't gone through expansion, > so you do not get what your expected result. > > However we can change your macro a little... > > > Ah, that clarifies everything. Thanks! > > So, the example I quoted is actually from the docs on ~datum, and it seems > pretty clear that it’s trying unsuccessfully to elicit different behaviors > that show the difference between ~literal and ~datum. Based on the code > you’ve provided, I think this would be a better illustration: > > (define-syntax (is-define? stx) > (syntax-parse stx > [(_is-define? id) > (syntax-parse #'id > [(~literal define) #''yes] > [(~datum define) #''not-really] > [_ #''not-even-close])])) > > (is-define? define) ;; 'yes > > (let ([define 42]) > (is-define? define)) ;; 'not-really > > (is-define? something-else) ;; 'not-even-close > > > I’ve submitted that as a PR on the doc file linked above. I hope you don’t > mind my using your example in that way. It was very helpful. > > Regards, > Jordan > > -- > 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. -- 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.