From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Stefan Monnier" Newsgroups: gmane.emacs.devel Subject: Re: struct.el -- a package to encode/decode binary data Date: Tue, 19 Mar 2002 07:34:36 -0500 Sender: emacs-devel-admin@gnu.org Message-ID: <200203191234.g2JCYaT01099@rum.cs.yale.edu> References: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1016541407 31575 127.0.0.1 (19 Mar 2002 12:36:47 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 19 Mar 2002 12:36:47 +0000 (UTC) Cc: "Kim F. Storm" , emacs-devel@gnu.org, Kenichi Handa Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 16nIr9-0008DB-00 for ; Tue, 19 Mar 2002 13:36:47 +0100 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 16nIwQ-0005fd-00 for ; Tue, 19 Mar 2002 13:42:14 +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 16nIqb-00024r-00; Tue, 19 Mar 2002 07:36:13 -0500 Original-Received: from rum.cs.yale.edu ([128.36.229.169]) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16nIpH-0001y5-00 for ; Tue, 19 Mar 2002 07:34:51 -0500 Original-Received: (from monnier@localhost) by rum.cs.yale.edu (8.11.6/8.11.6) id g2JCYaT01099; Tue, 19 Mar 2002 07:34:36 -0500 X-Mailer: exmh version 2.4 06/23/2000 with nmh-1.0.4 Original-To: Eli Zaretskii 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:2037 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:2037 > > While writing a package that sends and receives datagrams using the > > new make-network-process functionality, I quickly found that I needed > > to be able to encode and decode binary data structures, so I came up > > with the following package (struct.el). > > > > I'd like to hear if something like this already exists, or if others > > find it should be added to emacs (with more complete documentation of > > course). [Also, the struct-pack function doesn't work with nested > > data, but I'll fix that if there is an interest in this package]. > > I think it would be a very useful addition to Emacs, but I have one > comment about the implementation: I don't like (and that's an > understatement!) the idea of using unibyte strings. I especially get > shivers when I see string-make-unibyte and its ilk. While I agree that unibyte strings and buffers are sources of all sorts of problems, I think that storing binary data in multibyte strings and buffers is generally wrong. It's perfectly fine to use the eight-bit-control charset for the odd "unknown byte sequence", but for raw binary data, it's just a waste of memory and CPU resources. Stefan _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://mail.gnu.org/mailman/listinfo/emacs-devel