guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Guile: What's wrong with this?


From: Mark H Weaver
Subject: Re: Guile: What's wrong with this?
Date: Sat, 07 Jan 2012 11:13:16 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux)

Bruce Korb <address@hidden> writes:
> Fail early and fail hard.  Yes.  But after all these discussions, I
> now doubt I have too many places where I am expecting to change a
> static value.

That's good news! :)

> Most of the strings that I wind up altering are created with a
> scm_from_locale_string() C function call.

BTW, beware that scm_from_locale_string() is only appropriate for
strings that came from the user (e.g. command-line arguments, reading
from a port, etc).  When converting string literals from your own source
code, you should use scm_from_latin1_string() or scm_from_utf8_string().

Similarly, to make symbols from C string literals, use
scm_from_latin1_symbol() or scm_from_utf8_symbol().

Caveat: these functions did not exist in Guile 1.8.  If your C string
literals are ASCII-only, I guess it won't matter in practice which
function you use, although it would be good to spread the understanding
that C string literals should not be interpreted according to the user's
locale.

    Best,
     Mark



reply via email to

[Prev in Thread] Current Thread [Next in Thread]