diff options
| author | Philippe Schnoebelen | 2019-07-28 08:59:12 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2019-08-10 11:14:44 +0300 |
| commit | 65e4ebdfb6e78abac68ba9b9422fa6cd77028c16 (patch) | |
| tree | e9d069cdb8832506305a7df483e274272d885c4a | |
| parent | 721035d61c88967fe1f8f24c3c4a10f4b6237326 (diff) | |
| download | emacs-65e4ebdfb6e78abac68ba9b9422fa6cd77028c16.tar.gz emacs-65e4ebdfb6e78abac68ba9b9422fa6cd77028c16.zip | |
Support bool-vectors in cl-extra.el
* lisp/emacs-lisp/cl-extra.el (cl-coerce): Support bool-vector.
Copyright-paperwork-exempt: yes
| -rw-r--r-- | lisp/emacs-lisp/cl-extra.el | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el index 4dc2e9de58f..3a6def733f3 100644 --- a/lisp/emacs-lisp/cl-extra.el +++ b/lisp/emacs-lisp/cl-extra.el | |||
| @@ -48,6 +48,8 @@ TYPE is a Common Lisp type specifier. | |||
| 48 | \n(fn OBJECT TYPE)" | 48 | \n(fn OBJECT TYPE)" |
| 49 | (cond ((eq type 'list) (if (listp x) x (append x nil))) | 49 | (cond ((eq type 'list) (if (listp x) x (append x nil))) |
| 50 | ((eq type 'vector) (if (vectorp x) x (vconcat x))) | 50 | ((eq type 'vector) (if (vectorp x) x (vconcat x))) |
| 51 | ((eq type 'bool-vector) | ||
| 52 | (if (bool-vector-p x) x (apply #'bool-vector (cl-coerce x 'list)))) | ||
| 51 | ((eq type 'string) (if (stringp x) x (concat x))) | 53 | ((eq type 'string) (if (stringp x) x (concat x))) |
| 52 | ((eq type 'array) (if (arrayp x) x (vconcat x))) | 54 | ((eq type 'array) (if (arrayp x) x (vconcat x))) |
| 53 | ((and (eq type 'character) (stringp x) (= (length x) 1)) (aref x 0)) | 55 | ((and (eq type 'character) (stringp x) (= (length x) 1)) (aref x 0)) |