[racket] scribble/eval does not preserve syntax-original?

From: Casey Klein (clklein at eecs.northwestern.edu)
Date: Tue Aug 16 16:49:14 EDT 2011

Running this program:

  #lang racket/base

  (define binder #'x)
  (define bound #'x)

  (syntax-case (parameterize ([current-namespace (make-base-namespace)])
                 (expand `(λ (,binder) ,bound)))
    ()
    [(_ (_ (binder) bound))
     `([binder ,(syntax-original? #'binder)]
       [bound ,(syntax-original? #'bound)])])

produces:

  '((binder #t) (bound #t))

Rendering this Scribble document:

  #lang scribble/doc

  @(require scribble/eval)

    @examples[#:eval (make-base-eval)

            (define binder #'x)
            (define bound #'x)

            (syntax-case (parameterize ([current-namespace
(make-base-namespace)])
                           (expand `(λ (,binder) ,bound)))
              ()
              [(_ (_ (binder) bound))
               `([binder ,(syntax-original? #'binder)]
                 [bound ,(syntax-original? #'bound)])])]

produces:

  Examples:

      > (define binder #'x)
      > (define bound #'x)
      > (syntax-case (parameterize ([current-namespace (make-base-namespace)])
                       (expand `(λ (,binder) ,bound)))
          ()
          [(_ (_ (binder) bound))
           `([binder ,(syntax-original? #'binder)]
             [bound ,(syntax-original? #'bound)])])

      '((binder #f) (bound #f))

Should these identifiers not satisfy syntax-original?



Posted on the users mailing list.