guile-devel
[Top][All Lists]
Advanced

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

Re: The empty string and other empty strings


From: Mark H Weaver
Subject: Re: The empty string and other empty strings
Date: Tue, 10 Jan 2012 07:27:00 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux)

address@hidden (Ludovic Courtès) writes:
> Anyway, it seems that before, you couldn’t get any encoding error for
> scm_from_stringn ("", "SOME-ENCODING"), whereas now you can.

Good point.  I just committed a change to avoid this.

> A related question: can we have both narrow and wide empty strings?

I see one place where a wide null string could be created: vm-i-loader.c
line 115, within the "load-wide-string" vm instruction, calls
`scm_i_make_wide_string' but never calls `scm_i_try_narrow_string' as is
usually done.  I guess this might be because "load-wide-string" is
normally never used for strings that contain only Latin 1 characters.

Other than that, I don't see how a wide null string could exist outside
of temporaries, although it's hard to entirely rule out the possibility.
All of the code paths try to avoid using wide strings unless a wide
character is actually present.

If a wide null string did exist, I don't see what harm it would cause,
besides causing failure if `scm_i_string_chars' applied to it.

    Thanks,
      Mark



reply via email to

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