Download Firefox: WindowsMac OS X
logo       
Google Custom Search
    AddThis Social Bookmark Button

Re: [Fwd: [Schematics-development] SISC emit-annotations]: msg#00004

Subject: Re: [Fwd: [Schematics-development] SISC emit-annotations]
> 
> 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


<Prev in Thread] Current Thread [Next in Thread>