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 #52 received at 6878 <at> debbugs.gnu.org (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: MON KEY <monkey <at> sandpframing.com>
Cc: Chong Yidong <cyd <at> stupidchicken.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: Fri, 20 Aug 2010 04:23:52 +0200
On Fri, Aug 20, 2010 at 04:01, MON KEY <monkey <at> sandpframing.com> wrote:

> Emacs lisp doesn't and I can think of no good reasons to create 0
> length bool-vectors.
>
> Can any one else?

Of course. Eliminating special cases, for example.

(defun split-vec (v p)
  (list (substring v 0 p)
        (substring v p (length v))))

and you can do

  (apply 'vconcat (split-vec V N))

for N in -length(V)..length(V) and get back V

    Juanma




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.