[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Getting source location information

From: Ludovic Courtès
Subject: Getting source location information
Date: Wed, 30 Nov 2005 15:44:40 +0100
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux)

Bruce Korb <address@hidden> writes:

> Because the file is mostly *NOT* scheme.

I did say that you could use "Scheme constructs", "be it from Scheme
o[r] C code".  In other words, you can either write `(read)' in a piece
of Scheme code, or call `scm_read ()' from your C code: both are
strictly equivalent (well, almost).

The point is: do not rewrite what already exists because *this* is hard
to maintain.

Actually, what you want is `primitive-load' + `read' (which handles
piggy-backing of source location information as I said).  It is true,
however, that `primitive-load' (or, rather, `open-input-file') is not
guaranteed to use `mmap ()' the way you do it currently[*].  So if you
do want to make sure that the input file is `mmap'd the way you like,
then you may want to write your own variant of `primitive-load' (see

In any case, I can hardly imagine how Guile itself could be more helpful
than this.  ;-)


[*] Actually, Guile currently does not use `mmap ()' at all.  Perhaps
    file ports should be revised to take advantage of this where

reply via email to

[Prev in Thread] Current Thread [Next in Thread]