* Re: RFD: add an interface scm_c_eval_string_from_file_line
@ 2008-09-22 15:58 Bruce Korb
2008-09-22 20:09 ` Ludovic Courtès
0 siblings, 1 reply; 2+ messages in thread
From: Bruce Korb @ 2008-09-22 15:58 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: guile-devel
Hi,
On Mon, Sep 22, 2008 at 8:16 AM, Ludovic Courtès <ludo@gnu.org> wrote:
>> SCM expr = scm_makfrom0str( pzExpr );
>
> That's deprecated as of 1.8, use `scm_from_locale_string ()'.
This is used iff Guile antedates 1.6. I guess that can be junked now?
>> scm_t_port* pt;
>
> I wouldn't recommend using this structure as it's in a semi-internal,
> undocumented state. :-)
This is used iff Guile antedates 1.8. To my knowledge, there is no
other way to set the line number, prior to 1.8.
> Anyway, why not just use `scm_c_eval_string ()'? It'd be really safer
> than "rolling your own".
Because the strings are extracted from large text files and it is important
that the error message reveal the correct file and line number. It is
precisely because of the issues with cruft like using internal Guile
structures that I'd be so extremely happy to (finally) see a a proper export of:
scm_c_eval_string_from_file_line(SCM string, SCM file, SCM line)
Then for GUILE_VERSION >= 109000 I could just #define my variation
to the Proper Call. :)
Thank you! Regards, Bruce
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: RFD: add an interface scm_c_eval_string_from_file_line
2008-09-22 15:58 RFD: add an interface scm_c_eval_string_from_file_line Bruce Korb
@ 2008-09-22 20:09 ` Ludovic Courtès
0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2008-09-22 20:09 UTC (permalink / raw)
To: guile-devel
Hi,
"Bruce Korb" <bruce.korb@gmail.com> writes:
> On Mon, Sep 22, 2008 at 8:16 AM, Ludovic Courtès <ludo@gnu.org> wrote:
>>> SCM expr = scm_makfrom0str( pzExpr );
>>
>> That's deprecated as of 1.8, use `scm_from_locale_string ()'.
>
> This is used iff Guile antedates 1.6. I guess that can be junked now?
Yes.
>> Anyway, why not just use `scm_c_eval_string ()'? It'd be really safer
>> than "rolling your own".
>
> Because the strings are extracted from large text files and it is important
> that the error message reveal the correct file and line number. It is
> precisely because of the issues with cruft like using internal Guile
> structures that I'd be so extremely happy to (finally) see a a proper export of:
> scm_c_eval_string_from_file_line(SCM string, SCM file, SCM line)
> Then for GUILE_VERSION >= 109000 I could just #define my variation
> to the Proper Call. :)
Hmm, the port "API" is really one of the least pleasant parts of Guile.
:-) The issue, as you notice, is that it exposes a lot of internals and
is quite inconvenient.
Actually, now that I read it again, your code for GUILE_VERSION >= 107000
doesn't look that terrific---it's the compatibility code for 1.6 that's
quite hard to read.
Thanks,
Ludo'.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-09-22 20:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-22 15:58 RFD: add an interface scm_c_eval_string_from_file_line Bruce Korb
2008-09-22 20:09 ` Ludovic Courtès
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).