Subject: Re: bug#6878: bool-vectors of length 0 signal error when aref/aset the 0th element

From: Juanma Barranquero <[email-masked]>
Date: Fri, 20 Aug 2010 04:23:52 +0200

On Fri, Aug 20, 2010 at 04:01, MON KEY <[email-masked]> 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