From: Bruce Korb <bkorb@gnu.org>
To: Andy Wingo <wingo@pobox.com>
Cc: tès <ludo@gnu.org>,
Ludovic@gnu.org, "guile-devel Development" <guile-devel@gnu.org>
Subject: Re: reprise: scm_c_eval_string_from_file_line
Date: Tue, 08 Mar 2011 14:45:53 -0800 [thread overview]
Message-ID: <4D76B1A1.9020502@gnu.org> (raw)
In-Reply-To: <m3wrk98cy6.fsf@unquote.localdomain>
Hi Andy!
On 03/08/11 14:28, Andy Wingo wrote:
>> SCM
>> ag_scm_c_eval_string_from_file_line(
>> char const * pzExpr, char const * pzFile, int line)
>
> So! I implemented something, but it's not quite what you asked for.
Sufficiently close that the resulting code isn't "icky". :)
It no longer has the feel of tendrils stuck into the
workings of Guile code. It isn't as trivial to me, but then
maybe there aren't a lot of folks pulling text from various
files and feeding it to "eval-string".
So, this should go under:
#if GUILE_VERSION > 200000 // anything after 2.0, e.g. 2.0.1 ??
> You can change your implementation to this:
>
> {
> static SCM eval_string_var = SCM_BOOL_F;
>
> if (scm_is_false (eval_string_var))
> eval_string_var = scm_c_public_lookup ("ice-9 eval-string",
> "eval-string");
>
> return scm_call_5 (scm_variable_ref (eval_string_var),
> string,
Wouldn't this arg need to be SCM-ized? viz. scm_from_locale_string (string)
> scm_from_locale_keyword ("file"),
> pzFile ? scm_from_locale_string (pzFile) : SCM_BOOL_F,
> scm_from_locale_keyword ("line"),
> scm_from_int (line));
> }
>
> If you want to compile the expression, add #:compile? #t to the keyword
> arguments.
I guess I'll need to read docs. From this sentence, I'd be guessing
that I'd need to use "scm_call_7" and add:
scm_from_locale_keyword("#:compile?"), scm_from_locale_keyword("#t"),
to the arg list. I think you just added scm_call_5 for this purpose.
Anyway, thank you ! I do appreciate. Regards, Bruce
next prev parent reply other threads:[~2011-03-08 22:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.4.1298297717.17321.info-gnu@gnu.org>
[not found] ` <87vd0cqjvx.fsf@gnu.org>
[not found] ` <4D643043.6080406@gnu.org>
[not found] ` <4D658101.7030307@gnu.org>
[not found] ` <87sjvdl6ce.fsf@gnu.org>
2011-02-24 22:58 ` reprise: scm_c_eval_string_from_file_line Bruce Korb
2011-02-25 11:13 ` Andy Wingo
2011-03-08 22:28 ` Andy Wingo
2011-03-08 22:45 ` Bruce Korb [this message]
2011-03-08 22:52 ` Andy Wingo
2011-03-09 6:30 ` Mark H Weaver
2011-03-09 10:07 ` Ludovic Courtès
2011-03-09 20:15 ` Andy Wingo
2011-03-10 9:35 ` Bruce Korb
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=4D76B1A1.9020502@gnu.org \
--to=bkorb@gnu.org \
--cc=Ludovic@gnu.org \
--cc=guile-devel@gnu.org \
--cc=ludo@gnu.org \
--cc=wingo@pobox.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).