From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: Compiling Elisp to a native code with a GCC plugin Date: Fri, 17 Sep 2010 20:24:30 +0200 Organization: Organization?!? Message-ID: <87aang9qjl.fsf@lola.goethe.zz> References: <87bp805ecr.fsf@gmail.com> <87iq26z97e.fsf@uwakimon.sk.tsukuba.ac.jp> <87y6b0yi8o.fsf@uwakimon.sk.tsukuba.ac.jp> <87sk18bioh.fsf@lola.goethe.zz> <87fwx8bhkq.fsf@lola.goethe.zz> <8739t8bepl.fsf@lola.goethe.zz> <87tylo9vou.fsf@lola.goethe.zz> <87pqwc9tnm.fsf@lola.goethe.zz> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1284747893 31738 80.91.229.12 (17 Sep 2010 18:24:53 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 17 Sep 2010 18:24:53 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 17 20:24:51 2010 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.69) (envelope-from ) id 1OwfcB-00060s-7e for ged-emacs-devel@m.gmane.org; Fri, 17 Sep 2010 20:24:51 +0200 Original-Received: from localhost ([127.0.0.1]:35513 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OwfcA-0004m2-Lc for ged-emacs-devel@m.gmane.org; Fri, 17 Sep 2010 14:24:50 -0400 Original-Received: from [140.186.70.92] (port=53017 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Owfc4-0004ls-6B for emacs-devel@gnu.org; Fri, 17 Sep 2010 14:24:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Owfc0-0007MA-Ny for emacs-devel@gnu.org; Fri, 17 Sep 2010 14:24:44 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:47994) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Owfc0-0007Lr-9F for emacs-devel@gnu.org; Fri, 17 Sep 2010 14:24:40 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Owfby-0005uN-Iq for emacs-devel@gnu.org; Fri, 17 Sep 2010 20:24:38 +0200 Original-Received: from p508ea523.dip.t-dialin.net ([80.142.165.35]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 17 Sep 2010 20:24:38 +0200 Original-Received: from dak by p508ea523.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 17 Sep 2010 20:24:38 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 47 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: p508ea523.dip.t-dialin.net X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:e1sI0/heTFiEGQY9TUOnObjKs+E= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:130352 Archived-At: David Kastrup writes: > Andreas Schwab writes: > >> David Kastrup writes: >> >>> Lars Magne Ingebrigtsen writes: >>> >>>> Lars Magne Ingebrigtsen writes: >>>> >>>>> (looking-at (unibyte-string #x68 #xc3 #xa9 #x6c #x6c #x6f) t)héllo >>>>> => t >>>>> >>>>> *scratches head* Well, I guess I can see that... >>>> >>>> I've looked at what Fequal does. It first compares the number of >>>> characters in the strings, and then the number of bytes, and then it >>>> does a memcmp(). >>> >>> It also checks that the multibyteness is the same IIRC. >> >> If both the number of chars and bytes agree then they must be of the >> same multibyteness. > > Why? > > (length (string-as-multibyte "h\251llo")) => 5 > > (equal "h\251llo" (string-as-multibyte "h\251llo")) => nil Just seen that string-as-multibyte actually _does_ convert the content (did not use to do so pre-23). So string equality indeed does not check explicitly for multibyteness which is sort of ugly: (equal "abc" (string-to-multibyte "abc")) => t (string= "abc" (string-to-multibyte "abc")) => t (multibyte-string-p "abc") => nil (multibyte-string-p (string-to-multibyte "abc")) => t So it is likely that the correct way to deal with the uni/multibyte issue in the case of buffer/string comparison is the same: just check that both character and byte counts are identical. -- David Kastrup