On Mon, 2009-02-23 at 21:54 +0200, leppie wrote:
> ----- Original Message -----
> From: "Andreas Rottmann" <[email protected]>
> To: <[email protected]>
> Sent: Monday, February 23, 2009 9:34 PM
> Subject: [ikarus-users] Re: syntax->position
>
>
> >
> > kub <[email protected]> writes:
> >
> >> Hi,
> >> How can i obtain character position from syntax object ?
> >>
> > On a related note, is there some variation of `read' that returns a
> > syntax object with source (character) position, so you can get
> > reasonable error messages for files "included" at expand-time?
> >
> > Regards, Rotty
>
>
> From: (import (psyntax system $all))
>
> read-annotated
> annotation?
> annotation-expression
> annotation-source
> annotation-stripped
Those are also exported from (ikarus).
> (define x (read-annotated (open-string-input-port "blah")))
> x
#["annotation" blah ("*string-input-port*" . 1) blah]
> (annotation-expression x)
blah
> (annotation-source x)
("*string-input-port*" . 1)
> (annotation-stripped x)
blah
>
I'm not sure what the difference between the expression and stripped
fields is. You could probably infer what it is by searching for how
they're used in Ikarus.
You might not want to build on these too seriously unless Aziz tells you
it's a stable interface.
--
: Derick
----------------------------------------------------------------