]> git.eshelyaron.com Git - emacs.git/commitdiff
Support bool-vectors in cl-extra.el
authorPhilippe Schnoebelen <schnoebelen.ph@gmail.com>
Sun, 28 Jul 2019 06:59:12 +0000 (08:59 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sat, 10 Aug 2019 08:14:44 +0000 (11:14 +0300)
* lisp/emacs-lisp/cl-extra.el (cl-coerce): Support bool-vector.

Copyright-paperwork-exempt: yes

lisp/emacs-lisp/cl-extra.el

index 4dc2e9de58f6b57ad522ee89cfb1decd64a26da4..3a6def733f39e3d32aa9ab16363697d283c85df0 100644 (file)
@@ -48,6 +48,8 @@ TYPE is a Common Lisp type specifier.
 \n(fn OBJECT TYPE)"
   (cond ((eq type 'list) (if (listp x) x (append x nil)))
        ((eq type 'vector) (if (vectorp x) x (vconcat x)))
+       ((eq type 'bool-vector)
+         (if (bool-vector-p x) x (apply #'bool-vector (cl-coerce x 'list))))
        ((eq type 'string) (if (stringp x) x (concat x)))
        ((eq type 'array) (if (arrayp x) x (vconcat x)))
        ((and (eq type 'character) (stringp x) (= (length x) 1)) (aref x 0))