1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-28 10:56:36 +00:00

Fix cl-concatenate (Bug#40180)

* lisp/emacs-lisp/cl-extra.el (cl-concatenate): Use apply, to avoid
adding extra nesting of args.
* test/lisp/emacs-lisp/cl-extra-tests.el (cl-concatenate): New test.
This commit is contained in:
Noam Postavsky 2020-03-22 07:48:14 -04:00
parent 561e9fb91b
commit 9ab85f087f
2 changed files with 9 additions and 1 deletions

View File

@ -556,7 +556,7 @@ too large if positive or too small if negative)."
(defun cl-concatenate (type &rest sequences)
"Concatenate, into a sequence of type TYPE, the argument SEQUENCEs.
\n(fn TYPE SEQUENCE...)"
(seq-concatenate type sequences))
(apply #'seq-concatenate type sequences))
;;; List functions.

View File

@ -99,4 +99,12 @@
;; Test for Bug#33731.
(should-not (eq s (cl-make-random-state s)))))
(ert-deftest cl-concatenate ()
(should (equal (cl-concatenate 'list '(1 2 3) '(4 5 6))
'(1 2 3 4 5 6)))
(should (equal (cl-concatenate 'vector [1 2 3] [4 5 6])
[1 2 3 4 5 6]))
(should (equal (cl-concatenate 'string "123" "456")
"123456")))
;;; cl-extra-tests.el ends here