unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Joris van der Hoeven <TeXmacs@math.u-psud.fr>
Cc: Joris van der Hoeven <TeXmacs@math.u-psud.fr>
Subject: Re: Source locations
Date: Sun, 9 Feb 2003 20:05:24 +0100 (MET)	[thread overview]
Message-ID: <Pine.GSO.3.96.1030209200016.26546A-100000@anh> (raw)
In-Reply-To: <20030208172244.GA255@gmx.de>


Hi,

> > In the online guile manual, I found that the instruction
> > 
> > 	(read-enable 'positions)
> > 
> > should tell guile to remember positions in the source code.
> > 
> > How can I use this information? I would like to be able
> > to display a filename and a line/column number when
> > an error is encountered in an embedded guile program.
> 
> If you (read ...) some object `obj' from a file, you can do
> (source-property obj 'filename), (source-property obj 'line) and
> (source-property obj 'column) to get the position where this object
> has been read from.
> 
> Hope this helps.

Thanks for your answer.

Unfortunately, I still do not really understand how to make use of
this in order to display a filename and a line/column number when  
an error is encountered in an embedded guile program.
First of all, I am not sure whether I may use 'load' instead of 'read'.
Secondly, it seems that all this only gives me information about
the object which is read, but not about object which are obtained
indirectly through evaluation. For instance:

[vdhoeven@zonnebloem progs]$ guile
guile> (read-enable 'positions)
(keywords #f positions)
guile> (read-enable 'copy)     
(keywords #f positions copy)
guile> (define f (open-input-file "keywords/split.scm"))
guile> (define prg (read f))
guile> prg
(define process-list (quote ()))
guile> (eval prg)
guile> (source-property process-list 'filename)
standard input:8:1: In procedure source-property in expression
(source-property process-list (quote filename)):
standard input:8:1: Wrong type argument in position 1: ()
ABORT: (wrong-type-arg)

Type "(backtrace)" to get more information.
guile> (source-property prg 'filename)
"keywords/split.scm"
guile> 

Thanks for your attention, Joris


-----------------------------------------------------------
Joris van der Hoeven <vdhoeven@texmacs.org>
http://www.texmacs.org: GNU TeXmacs scientific text editor
http://www.math.u-psud.fr/~vdhoeven: personal homepage
-----------------------------------------------------------




_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user


  reply	other threads:[~2003-02-09 19:05 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-08 11:12 Source locations Joris van der Hoeven
2003-02-08 17:22 ` Wolfgang Jaehrling
2003-02-09 19:05   ` Joris van der Hoeven [this message]
2003-02-25 14:19     ` PLEASE: debugging embedded guile code Joris van der Hoeven
2003-02-25 14:36       ` Dale P. Smith
2003-02-27 12:17         ` Customized error reports Joris van der Hoeven
2003-02-28 18:06           ` Paul Jarc
2003-04-26 14:51         ` PLEASE: debugging embedded guile code Neil Jerram
2003-04-26 16:40           ` Bruce Korb
2003-04-26 19:12             ` Neil Jerram
2003-04-26 20:13               ` Bruce Korb
2003-04-26 22:25                 ` Thien-Thi Nguyen
2003-04-27 20:49                 ` Neil Jerram
2003-04-27 21:57                   ` Bruce Korb
2003-04-28 15:54                     ` Paul Jarc
2003-04-28 16:07                       ` Bruce Korb
2003-04-28 19:21                     ` Neil Jerram
2003-04-28 20:06                       ` Bruce Korb
2003-04-28 20:58                         ` Neil Jerram
2003-05-16 17:19                           ` Bruce Korb
2003-05-16 19:23                             ` Neil Jerram
2003-05-16 20:27                               ` Bruce Korb
2003-05-16 21:21                                 ` Rob Browning
2003-05-16 21:56                                   ` Bruce Korb
2003-05-17  0:31                                     ` Bruce Korb
2003-05-17  2:33                                       ` Bruce Korb
2003-05-19 15:00                                         ` Paul Jarc
2003-04-28 13:52           ` Mikael Djurfeldt
2003-04-28 19:26             ` Neil Jerram
2003-04-26 14:45       ` Neil Jerram

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.GSO.3.96.1030209200016.26546A-100000@anh \
    --to=texmacs@math.u-psud.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).