[plt-scheme] Changing source location information

From: Eli Barzilay (eli at barzilay.org)
Date: Tue Aug 4 10:27:32 EDT 2009

On Aug  4, Jens Axel Søgaard wrote:
> Hi All,
> I want to use the at-exp syntax for a little macro.  My problem is
> how to produce the correct source location when reading from the
> string.
> A simple version of the problem can be seen in the macro foo below.

I'm not sure what is exactly the problem with at-exp -- I see both
uses suffering from the same problem.  In any case, I think that
you're missing a third #'str in

  (datum->syntax #'str (syntax->datum result) #'str)

(But I'm not sure I'm following the code, looks like the
`syntax->datum' is a temporary hack to figure out what's wrong?)

To make it work better, you'll want to scan the resulting syntax, and
adjust source information from the string to correspond to the
location in the real source.

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

Posted on the users mailing list.