On Mon, 2009-02-23 at 20:34 +0100, Andreas Rottmann wrote:
> 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?

I'm not sure this entirely addresses what you're looking for, but the
normal read already does that for my include library:

$ cat bad-lexical.scm 
(define x -oops)
$ cat use-bad-lexical.sps 
(import (rnrs)
        (xitomatl include))
(include "bad-lexical.scm")
$ ikarus --r6rs-script use-bad-lexical.sps 
Unhandled exception:
 Condition components:
   1. &error
   2. &who: include/lexical-context
   3. &message: "error while trying to include"
   4. &irritants: ("bad-lexical.scm")
   5. &lexical
   6. &message: "invalid numeric sequence"
   7. &irritants: ("-o")
   8. &source-position:
       file-name: "bad-lexical.scm"
       character: 11
$ 

-- 
: Derick
----------------------------------------------------------------

Reply via email to