GNU bug report logs - #6878
bool-vectors of length 0 signal error when aref/aset the 0th element

Previous Next

Package: emacs;

Reported by: MON KEY <monkey <at> sandpframing.com>

Date: Wed, 18 Aug 2010 04:19:02 UTC

Severity: minor

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

Full log


Message #49 received at 6878 <at> debbugs.gnu.org (full text, mbox):

From: MON KEY <monkey <at> sandpframing.com>
To: Chong Yidong <cyd <at> stupidchicken.com>
Cc: Juanma Barranquero <lekktu <at> gmail.com>,
	Andreas Schwab <schwab <at> linux-m68k.org>, 6878 <at> debbugs.gnu.org,
	Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#6878: bool-vectors of length 0 signal error when aref/aset
	the 0th element
Date: Thu, 19 Aug 2010 22:01:43 -0400
On Thu, Aug 19, 2010 at 7:24 PM, Chong Yidong <cyd <at> stupidchicken.com> wrote:
> MON KEY <monkey <at> sandpframing.com> writes:
>
>> The manual says a `t' or `nil' "must" be there.
>
> Admittedly, the wording in the manual makes it possible for a reader to
> misinterpret it, if he is determined to do so.  I have changed it to
> read

It isn't the determined reader its the haphazer user...

>
>    A @dfn{bool-vector} is a one-dimensional array whose elements must
>  be @code{t} or @code{nil}.
>
> which should be less ambiguous.  Thus, I'm closing this bug.
>

As you wish. Though, I don't think changing the wording solves the real problem
If there are no good reasons to create a boole-vectro of length 0 why allow it?

FWICG older lisp dialects from which Emacs lisp derives used bit arrays in
special ways e.g. LispM Lisp `bitblt' and `boole' related functions see the Lisp
Machine Manual page 123 (of 484) and page 92 (of 484) of pdf here:
 (URL `http://www.bitsavers.org/pdf/mit/cadr/chinual_3rdEd_Mar81.pdf')

But these systems/dialects allowed array indirction and size extension.

Emacs lisp doesn't and I can think of no good reasons to create 0
length bool-vectors.

Can any one else?

If there are no good reasons to create a boole-vector of length 0 and nothing
good to do with them even when you can do it why allow it to occur in
the first place?

This said, its doubtfull the feature would be missed either way.
Though apparently frobbing the lsb has interesting steganographic utility...

rgrep'ing "make-boole-vector" in lisp/
finds only two active uses of `make-bool-vector' appearing in /lisp:

emacs-lisp/sregex.el's `sregex--char-aux'

play/mpuz.el
`mpuz-found-digits'
`make-bool-vector'

Its use was deprecated in the following places:

lisp/ChangeLog.10
2001-10-21  Miles Bader  <miles <at> gnu.org>

* wid-edit.el (checkbox): Swap bg/fg colors in image, and invert
  image bits to compensate.  Use `make-string' instead of
  `make-bool-vector' (XBM apparently wants byte-aligned rows).
revno: 40075

:from
!   :off-glyph (create-image (make-bool-vector 49 1)
:to
!   :off-glyph (create-image (make-string 7 0)


lisp/ChangeLog.9
2000-08-09  Stefan Monnier  <monnier <at> cs.yale.edu>
* emacs-lisp/regexp-opt.el (make-bool-vector): Remove.
revno: 32042

:from
!   (let* ((charwidth 256)				; Yeah, right.
! 	 (charmap (make-bool-vector charwidth nil))
:to
!   (let* ((charmap (make-char-table 'case-table))

--
/s_P\




This bug report was last modified 14 years and 337 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.