[plt-scheme] Expanding into this-expression-file-name

From: Eli Barzilay (eli at barzilay.org)
Date: Tue Aug 22 12:24:32 EDT 2006

On Aug 22, Noel Welsh wrote:
> This works:
> 
>   ;; syntax this-expression-benchmark-log-file : () -> path
>   (define-syntax (this-expression-benchmark-log-file stx)
>     (syntax-case stx ()
>       [(this-expression-benchmark-log-file)
>        (with-syntax ([expr
>                       (datum->syntax-object
>                        stx
>                        '(build-path
>                          (this-expression-source-directory)
>                          (string-append
>                           (path->string
> (this-expression-file-name))
>                           ".benchmark-log"))
>                        stx)])
>          (syntax expr))]))
> 
> Don't know why -- I should think the context and lexical
> information I supply are identical to my original code, but
> obviously not.

Regardless of that, you could just do what `this-expression-...' does,
and use the location properties directly.

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!


Posted on the users mailing list.