bug-gnu-emacs
[Top][All Lists]
Advanced

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

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


From: Juanma Barranquero
Subject: 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@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





reply via email to

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