unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: Bruce Korb <bkorb@gnu.org>
Cc: guile-devel@gnu.org, Rob Browning <rlb@defaultvalue.org>
Subject: Re: [PATCH 1/1] scm_set_source_properties_x: optimize if only name, line, and/or col
Date: Tue, 09 Mar 2021 21:52:03 +0100	[thread overview]
Message-ID: <87eego2gp8.fsf@pobox.com> (raw)
In-Reply-To: <3a393e11-15b4-6504-47da-aea9e950446d@gnu.org> (Bruce Korb's message of "Sun, 17 Jan 2021 14:55:53 -0800")

On Sun 17 Jan 2021 23:55, Bruce Korb <bkorb@gnu.org> writes:

> [Can I] swap out this code for something better now? I've disliked
> this code for years.
>
>> static SCM
>> ag_scm_c_eval_string_from_file_line(
>>     char const * pzExpr, char const * pzFile, int line)

Since Guile 2.0.1 you can

  (use-modules (ice-9 eval-string))
  (eval-string str #:file file #:line line)

From C:

  SCM_KEYWORD (k_file, "file");
  SCM_KEYWORD (k_line, "line");

  ...

  SCM ans =
    scm_call_5 (scm_c_public_ref ("ice-9 eval-string", "eval-string"),
                scm_from_utf8_string (str),
                k_file, scm_from utf8_string (file),
                k_line, scm_from_int (line));

Regards,

Andy



      reply	other threads:[~2021-03-09 20:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-17 22:24 [PATCH 1/1] scm_set_source_properties_x: optimize if only name, line, and/or col Rob Browning
2021-01-17 22:55 ` Bruce Korb
2021-03-09 20:52   ` Andy Wingo [this message]

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=87eego2gp8.fsf@pobox.com \
    --to=wingo@pobox.com \
    --cc=bkorb@gnu.org \
    --cc=guile-devel@gnu.org \
    --cc=rlb@defaultvalue.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).