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

From: Noel Welsh (noelwelsh at yahoo.com)
Date: Tue Aug 22 09:31:55 EDT 2006

Hi all,

I have a macro that expands into this-expression-file-name.
 I want the file name of the point of use, but I get the
file name of the point of definition.  How do I get the
macro to use the source information of the expansion point?
 Current code below.

Thanks,
Noel

  ;; syntax this-expression-benchmark-log-file : () -> path
  (define-syntax (this-expression-benchmark-log-file stx)
    (syntax-case stx ()
      [(this-expression-benchmark-log-file)
       ;; result is the same w/ just syntax instead of
syntax/loc
       (syntax/loc stx
         (build-path
          (this-expression-source-directory)
          (string-append
           (path->string (this-expression-file-name))
           ".benchmark-log")))]))

Email: noelwelsh <at> yahoo <dot> com   noel <at> untyped <dot> com
AIM: noelhwelsh
Blogs: http://monospaced.blogspot.com/  http://www.untyped.com/untyping/

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


Posted on the users mailing list.