Bruce Korb <bk...@gnu.org> 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