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: (aset UNIBYTE-STRING MULTIBYTE-CHAR) Date: Wed, 13 Feb 2008 12:48:07 +0900 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII X-Trace: ger.gmane.org 1202874556 12321 80.91.229.12 (13 Feb 2008 03:49:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 13 Feb 2008 03:49:16 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 13 04:49:39 2008 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 1JP8cq-00045d-39 for ged-emacs-devel@m.gmane.org; Wed, 13 Feb 2008 04:49:36 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JP8cM-0002Gn-I4 for ged-emacs-devel@m.gmane.org; Tue, 12 Feb 2008 22:49:06 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JP8cI-0002Ga-N0 for emacs-devel@gnu.org; Tue, 12 Feb 2008 22:49:02 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JP8cH-0002GJ-0I for emacs-devel@gnu.org; Tue, 12 Feb 2008 22:49:02 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JP8cG-0002GG-Su for emacs-devel@gnu.org; Tue, 12 Feb 2008 22:49:00 -0500 Original-Received: from mx1.aist.go.jp ([150.29.246.133]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JP8cG-00068a-2V for emacs-devel@gnu.org; Tue, 12 Feb 2008 22:49:00 -0500 Original-Received: from rqsmtp2.aist.go.jp (rqsmtp2.aist.go.jp [150.29.254.123]) by mx1.aist.go.jp with ESMTP id m1D3m8tu020106; Wed, 13 Feb 2008 12:48:08 +0900 (JST) env-from (handa@m17n.org) Original-Received: from smtp4.aist.go.jp by rqsmtp2.aist.go.jp with ESMTP id m1D3m8gb010359; Wed, 13 Feb 2008 12:48:08 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp4.aist.go.jp with ESMTP id m1D3m7CR009844; Wed, 13 Feb 2008 12:48:07 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken.m17n.org with local (Exim 4.68) (envelope-from ) id 1JP8bP-0004ZO-FJ; Wed, 13 Feb 2008 12:48:07 +0900 In-reply-to: (message from Stefan Monnier on Tue, 12 Feb 2008 21:49:46 -0500) User-Agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/23.0.60 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) X-detected-kernel: by monty-python.gnu.org: 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:88930 Archived-At: In article , Stefan Monnier writes: > > Before the unicode merge, this worked: > > (let ((str "a")) (aset str 0 (decode-char 'ucs #x100))) > > In emacs-unicode-2 branch, there was a discussion about the > > rightness of aset changing the multibyteness of a string, > > and I changed the code to signal an error in the above case. > An error sounds right. For this: (let ((str "\300")) (aset str 0 (decode-char 'ucs #x100))) an error may be ok. But for the first example, although "a" is currently treated as a unibyte string, I think it's more like multibyteness-not-yet-decided, i.e. it's neutral about the multibyteness. > > But, I got reports claiming that the change breaks some of > > already existing Elisp packages. Although changing the > Details? Something like this code: (setq result (cons (let ((str (make-string 1 0))) (aset str 0 (make-char 'japanese-jisx0208 ku ten)) although it's easy to fix it... > > What do you think is the right thing for this matter? > aset on strings is fundamentally problematic, so anything that restricts > it further is good in my book (my own local Emacs disallows them > plainly, and I rarely bump into code that needs it). What is the fundamental problem? --- Kenichi Handa handa@ni.aist.go.jp