Re: [Fwd: [Schematics-development] SISC emit-annotations]

[email protected] Thu, 5 May 2005 13:56:59 -0500
Newsgroups gmane.comp.java.sisc.devel
Message-ID <[email protected]>
> 
> That is to say, in a macro expansion
> 
>      (foo a b c)
> 
> FOO doesn't have location information but A, B, C do.
> 
> So for SchemeUnit it might indeed be possible to pull the location
> information out of the macro arguments.
> 
> By the way, is there an API for getting location information from a
> syntax object?
> 
> Thanks,

Not officially, but this should work:


(define (source-annotation x)
  (cond [(syntax-object? x (annotation-source (vector-ref x 1)))]
        [else (error 'source-annotation 
                     "expected a syntax object, got: ~a" x)]))

Its a hack though.

	Scott


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20