emacs-devel
[Top][All Lists]
Advanced

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

Re: using empty_string as the only "" string


From: Kenichi Handa
Subject: Re: using empty_string as the only "" string
Date: Wed, 25 Apr 2007 20:56:38 +0900
User-agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/23.0.0 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

In article <address@hidden>, "dmantipov" <address@hidden> writes:

> > You can modify the multibyteness of an empty string, and a
> > unibyte empty string and a multibyte empty string behave a
> > little bit differently, for instance, when concatinated with
> > an unibyte 8-bit string.

> How you can modify the multibyteness of an empty string?

Ah, sorry, my mistake.  But your change make it impossible
to make an empty multibyte string.

> You can't aset
> multibyte char (as well as anything else) into empty string, and conversion
> functions like 'string-make-unibyte' or 'string-to-multibyte' always creates
> new strings instead of touching an argument. Moreover, since "" is a
> no-op in concatenation operations, it may be silently discarded without
> looking into internal structure, isn't it ?

Unfortunately no.  Currently Emacs behaves as this:

(concat "" "\300") => "\300"
(concat (string-to-multibyte "") "\300") => "$(D*"(B"

Of course, with more changes to alloc.c, we can keep unique
multibyte empty string and unique unibyte empty string.

But, is it really worth working on that?

---
Kenichi Handa
address@hidden




reply via email to

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