On Sun 17 Jan 2021 23:55, Bruce Korb <bk...@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 via email to