emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: struct.el -- a package to encode/decode binary data


From: Stefan Monnier
Subject: Re: struct.el -- a package to encode/decode binary data
Date: Tue, 19 Mar 2002 07:34:36 -0500

> > 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]