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


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: MON KEY <monkey <at> sandpframing.com>
Cc: 6878 <at> debbugs.gnu.org
Subject: bug#6878: bool-vectors of length 0 signal error when aref/aset the 0th element
Date: Wed, 18 Aug 2010 09:36:55 +0200
> When aref/aset'ing the 0th element of a bool-vectors of length 0 i get
> an args-out-of-range error:

To have a 0th element, an array needs to be of length >= 1.
So this behavior seems perfectly correct to me.
An array of length N has elements 0..N-1, so an array of length
0 doesn't have any elements at all.  This should be true of strings,
vectors, and bool-vectors.


        Stefan




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.