From: Bruce Korb <bruce.korb@gmail.com>
Cc: guile-devel@gnu.org
Subject: Re: Getting source location information
Date: Wed, 30 Nov 2005 08:58:49 -0800 [thread overview]
Message-ID: <200511300858.49886.bruce.korb@gmail.com> (raw)
In-Reply-To: <87psoixgtv.fsf@laas.fr>
On Wednesday 30 November 2005 08:04 am, Ludovic Courtès wrote:
*Thank you*, Ludvic! Now we're getting some where. :-D
> That the input file does not contain only Scheme source wasn't clear to
> me.
What I am doing is extracting Scheme code from an encompassing
template and handing it off for evaluation.
When I said that, I was meaning to say that the file was
not pure scheme code.
> Then, in fact, it would make sense to use `scm_c_eval_string ()',
> provided your tool is able to determine the boundaries of the Scheme
> expression (if it's not, you'd better use `scm_read ()').
It is easily done.
> If you want to use source locations in a
> Guile-friendly way (so that Guile can, for instance, display location
> information in backtraces),
*YES* !!!
> then you may want to use
> `scm_set_source_property_x (sexp, key, datum)' (where KEY may be one of
> SCM_SYM_FILENAME, SCM_SYM_LINE, SCM_SYM_COLUMN) which is defined in
> `srcprop.h'.
So, again, I need clarity. Are you saying this:
SCM res;
SCM code = scm_from_locale_string (extracted_text);
SCM file = scm_from_locale_string (file_name);
SCM line = scm_from_int (line);
scm_set_source_property_x (code, SCM_SYM_FILENAME, file);
scm_set_source_property_x (code, SCM_SYM_LINE, line);
res = scm_primitive_eval (code)
> But again, this is a problem (and a solution) relevant to your tool, not
> to Guile in general.
Well, actually, I disagree. If any application wants to cope with
embedded Guile extensions in their input files, they either have to
solve this problem or else give up on being able to have Guile error
messages reference the source location. My guess is is that other
folks just invoke scm_c_eval_string() and don't sweat the message
locations. That is what I first did. Then, I learned that getting
location information was possible. However, the only way I could do
it was by writing a piece of obnoxious code that delved deep into the
bowels of Guile. That was wrong, but more important than not having
file and line information. Now, the 1.7 implementation has invalidated
portions of the non-deprecated 1.6 interface that I have been using.
I am forced to rewrite a lot of stuff as a consequence. Here I am. :)
Thanks again for all your help. Regards, Bruce
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel
next prev parent reply other threads:[~2005-11-30 16:58 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-28 4:25 I don't want to maintain this Bruce Korb
2005-11-29 8:16 ` Ludovic Courtès
2005-11-29 20:14 ` Bruce Korb
2005-11-30 8:39 ` Ludovic Courtès
2005-11-30 12:30 ` Bruce Korb
2005-11-30 13:46 ` Ludovic Courtès
2005-11-30 14:00 ` Bruce Korb
2005-11-30 14:44 ` Getting source location information Ludovic Courtès
2005-11-30 15:30 ` Bruce Korb
2005-11-30 16:04 ` Ludovic Courtès
2005-11-30 16:58 ` Bruce Korb [this message]
2005-11-30 17:39 ` Ludovic Courtès
2005-12-01 12:19 ` Ludovic Courtès
2005-11-30 19:00 ` Rob Browning
2005-11-30 20:53 ` Bruce Korb
2005-11-30 22:35 ` Rob Browning
2005-11-30 23:30 ` Bruce Korb
2005-12-14 21:54 ` Kevin Ryde
2005-11-30 23:45 ` Han-Wen Nienhuys
2005-12-01 0:30 ` I don't want to maintain this Kevin Ryde
2005-12-01 0:38 ` Kevin Ryde
2005-12-07 0:36 ` Marius Vollmer
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=200511300858.49886.bruce.korb@gmail.com \
--to=bruce.korb@gmail.com \
--cc=guile-devel@gnu.org \
/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).