From: Bruce Korb <bruce.korb@gmail.com>
To: Noah Lavine <noah.b.lavine@gmail.com>
Cc: Mark H Weaver <mhw@netris.org>, guile-devel@gnu.org
Subject: Re: unknown location: definition in expression context in subform optname-from of "_^"
Date: Thu, 26 Jan 2012 19:36:51 -0800 [thread overview]
Message-ID: <4F221BD3.8090105@gmail.com> (raw)
In-Reply-To: <CA+U71=MZ91AGoWurkGKdX6DG4JpC2C7g6vdEXpcEhU-K=BGs+w@mail.gmail.com>
On 01/26/12 18:59, Noah Lavine wrote:
> Hello,
>
>> /* Read expressions from that port; ignore the values. */
>> for (;;) {
>> SCM form = scm_read(port);
>> if (SCM_EOF_OBJECT_P(form))
>> break;
>> ans = scm_primitive_eval_x(form);
>> }
>>
>> return ans;
>> }
>> }
>>
>> Every evaluation comes from here and in this instance, "pzFile"
>> pointed to "/path/to/aginfo.tpl" and "line" was set to 163.
>> Therefore, the location should *NOT* have been unknown and
>> in fact, the displayed line number ought to have been 171.
>>
>> Why that failed I would very much want to know so that I can
>> fix this ag_scm_c_eval_string_from_file_line() thingy.
>
> I am not an expert, but this is my guess about what's happening: you
> get the form from the file with scm_read. scm_read returns a regular
> s-expression, not a syntax object. Then you pass this form to
> scm_primitive_eval_x. scm_primitive_eval_x has a plain syntax-object
> with no way to know where it came from, so it prints "unknown
> location".
Nope. My code is parsing a text file, keeping track of file and line.
The "pzExpr" argument is, indeed, an array of UTF-8/ASCII text
from a file and line number known and also passed in.
So, I am getting the "form" from that read on the string port
and my expectation is that Guile advances the line/column numbers
set in the calls above. If this is not true, then I need explicit
instructions on *exactly* what I need to do in order for the
"unknown location" to be a known location.
> But note that I didn't say that you could do this. I don't know of an
> interface to this functionality (although I believe this example shows
> that we need one).
It has been an issue I've been arguing for years and years and years,
ever since the trivial 1.6(4?) methodology (fiddling with obviously correct,
but very wrong to do, Guile internal data structures) became disabled.
Look in the email archives for ag_scm_c_eval_string_from_file_line.
http://lists.gnu.org/archive/html/guile-devel/2005-11/msg00052.html
I made the name very long so it would be easy to Google for. :)
So I will repeat my request (and, please forgive the irritation,
because I have, after all, been asking for a really long time):
I need to be able to locate a guile scheme expression in my ASCII
text input and hand it off to Guile, telling it the file name and
line number and column number of where I found the string. In this way,
when there is an evaluation error, something more sensible than
"unknown location" is displayed for the location information.
Thank you for reconsidering.
Regards, Bruce
next prev parent reply other threads:[~2012-01-27 3:36 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-26 3:56 unknown location: definition in expression context in subform optname-from of "_^" Bruce Korb
2012-01-26 4:22 ` Mike Gran
2012-01-26 5:31 ` David Kastrup
2012-01-26 21:05 ` Bruce Korb
2012-01-26 21:21 ` Mike Gran
2012-01-26 21:37 ` Bruce Korb
2012-01-27 0:10 ` Mark H Weaver
2012-01-27 0:56 ` Bruce Korb
2012-01-27 2:26 ` Mark H Weaver
2012-01-27 2:44 ` Bruce Korb
2012-01-27 2:59 ` Noah Lavine
2012-01-27 3:36 ` Bruce Korb [this message]
2012-01-28 7:02 ` Mark H Weaver
2012-01-28 16:58 ` Bruce Korb
2012-01-28 19:03 ` Andy Wingo
2012-01-28 19:47 ` Mark H Weaver
2012-01-28 22:58 ` Andy Wingo
2012-01-29 4:12 ` Mark H Weaver
2012-01-29 17:40 ` Bruce Korb
2012-01-29 18:06 ` Mike Gran
2012-01-29 20:28 ` Andy Wingo
2012-01-29 21:14 ` Bruce Korb
2012-01-29 21:32 ` Mark H Weaver
2012-01-28 22:59 ` Andy Wingo
2012-01-27 6:27 ` Mark H Weaver
2012-01-27 6:19 ` Mark H Weaver
2012-01-27 14:04 ` Bruce Korb
2012-01-27 14:32 ` Mark H Weaver
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=4F221BD3.8090105@gmail.com \
--to=bruce.korb@gmail.com \
--cc=guile-devel@gnu.org \
--cc=mhw@netris.org \
--cc=noah.b.lavine@gmail.com \
/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).