From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Eli Zaretskii" Newsgroups: gmane.emacs.devel Subject: Re: struct.el -- a package to encode/decode binary data Date: Fri, 22 Mar 2002 13:04:11 +0200 Sender: emacs-devel-admin@gnu.org Message-ID: <2427-Fri22Mar2002130411+0200-eliz@is.elta.co.il> References: <5x663qgcfp.fsf@kfs2.cua.dk> <200203211658.g2LGwYK17907@rum.cs.yale.edu> <2950-Thu21Mar2002214509+0200-eliz@is.elta.co.il> <200203220105.g2M159I19881@rum.cs.yale.edu> Reply-To: Eli Zaretskii NNTP-Posting-Host: localhost.gmane.org X-Trace: main.gmane.org 1016795365 5319 127.0.0.1 (22 Mar 2002 11:09:25 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 22 Mar 2002 11:09:25 +0000 (UTC) Cc: storm@cua.dk, emacs-devel@gnu.org Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 16oMvF-0001Ng-00 for ; Fri, 22 Mar 2002 12:09:25 +0100 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 16oN1s-00053T-00 for ; Fri, 22 Mar 2002 12:16:17 +0100 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16oMv6-0003N7-00; Fri, 22 Mar 2002 06:09:16 -0500 Original-Received: from balder.inter.net.il ([192.114.186.15]) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16oMtZ-0002fw-00 for ; Fri, 22 Mar 2002 06:07:41 -0500 Original-Received: from zaretsky (diup-217-59.inter.net.il [213.8.217.59]) by balder.inter.net.il (Mirapoint) with ESMTP id BGQ36304; Fri, 22 Mar 2002 13:07:29 +0200 (IST) Original-To: monnier+gnu/emacs@rum.cs.yale.edu X-Mailer: emacs 21.2.50 (via feedmail 8 I) and Blat ver 1.8.9 In-Reply-To: <200203220105.g2M159I19881@rum.cs.yale.edu> (monnier+gnu/emacs@rum.cs.yale.edu) Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.5 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:2120 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:2120 > From: "Stefan Monnier" > Date: Thu, 21 Mar 2002 20:05:09 -0500 > > > Most of them, those between 160 and 255 _are_ represented as a single > > byte, even in a multibyte string/buffer. That's the eight-bit-graphic > > character set. > > Interesting. It still means that binary values between 128 and 160 > (i.e. from eight-bit-control) are posing problems when calling `aset'. Yes, that's true. So moving through a multibyte buffer/string with binary data is slightly less efficient than with unibyte buffer/string (assuming a uniform distribution of possible 8-bit values in the range [0..255]). Moving *back* through such buffers/strings is especially painful, since you cannot in advance find the head of the multibyte sequence, which tells how many bytes to move to skip the character. However, I think in code that constructs numbers from binary data you don't normally need to move back, or use aset. You normally need to move/scan forward a small number of bytes, while you accumulate their values into a number. That should be reasonably efficient, and so using unibyte strings doesn't seem to be justified. _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://mail.gnu.org/mailman/listinfo/emacs-devel