From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel Subject: Re: using empty_string as the only "" string Date: Wed, 25 Apr 2007 20:56:38 +0900 Message-ID: References: <462EE947.000007.15251@camay.yandex.ru> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=ISO-2022-JP-2 X-Trace: sea.gmane.org 1177502313 23321 80.91.229.12 (25 Apr 2007 11:58:33 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 25 Apr 2007 11:58:33 +0000 (UTC) Cc: emacs-devel@gnu.org To: dmantipov@yandex.ru Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 25 13:58:32 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Hgg8j-0004x2-Ey for ged-emacs-devel@m.gmane.org; Wed, 25 Apr 2007 13:58:29 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HggEL-0001RH-Ep for ged-emacs-devel@m.gmane.org; Wed, 25 Apr 2007 08:04:17 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HggCj-0008MW-FM for emacs-devel@gnu.org; Wed, 25 Apr 2007 08:02:37 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HggCh-0008JZ-Bq for emacs-devel@gnu.org; Wed, 25 Apr 2007 08:02:36 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HggCg-0008J5-7N for emacs-devel@gnu.org; Wed, 25 Apr 2007 08:02:35 -0400 Original-Received: from mx1.aist.go.jp ([150.29.246.133]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Hgg72-0000BG-Vc for emacs-devel@gnu.org; Wed, 25 Apr 2007 07:56:45 -0400 Original-Received: from rqsmtp2.aist.go.jp (rqsmtp2.aist.go.jp [150.29.254.123]) by mx1.aist.go.jp with ESMTP id l3PBugCo017987; Wed, 25 Apr 2007 20:56:42 +0900 (JST) env-from (handa@m17n.org) Original-Received: from smtp4.aist.go.jp by rqsmtp2.aist.go.jp with ESMTP id l3PBugBe024546; Wed, 25 Apr 2007 20:56:42 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp4.aist.go.jp with ESMTP id l3PBucVC026941; Wed, 25 Apr 2007 20:56:38 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken.m17n.org with local (Exim 4.63) (envelope-from ) id 1Hgg6w-0002JV-Fl; Wed, 25 Apr 2007 20:56:38 +0900 In-reply-to: <462EE947.000007.15251@camay.yandex.ru> (dmantipov@yandex.ru) 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) X-detected-kernel: Solaris 8 (1) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:70092 Archived-At: In article <462EE947.000007.15251@camay.yandex.ru>, "dmantipov" 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 handa@m17n.org