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

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

bug#39761: [PATCH] Eliminate use of cl-concatenate in 'seq' package


From: Andrew Eggenberger
Subject: bug#39761: [PATCH] Eliminate use of cl-concatenate in 'seq' package
Date: Thu, 27 Feb 2020 21:43:47 -0600

Fixes (Bug#39761) by making cl-extra dependent on seq rather than
vice versa.
* lisp/emacs-lisp/seq.el (seq-concatenate): Move cl-concatenate's
code here instead of calling it.
* lisp/emacs-lisp/cl-extra.el (cl-concatenate): Use cl-concatenate.
---
 lisp/emacs-lisp/cl-extra.el | 6 +-----
 lisp/emacs-lisp/seq.el      | 6 +++++-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el
index e3dabdfcef..e9bfe8df5f 100644
--- a/lisp/emacs-lisp/cl-extra.el
+++ b/lisp/emacs-lisp/cl-extra.el
@@ -556,11 +556,7 @@ cl-subseq
 (defun cl-concatenate (type &rest sequences)
   "Concatenate, into a sequence of type TYPE, the argument SEQUENCEs.
 \n(fn TYPE SEQUENCE...)"
-  (pcase type
-    ('vector (apply #'vconcat sequences))
-    ('string (apply #'concat sequences))
-    ('list (apply #'append (append sequences '(nil))))
-    (_ (error "Not a sequence type name: %S" type))))
+  (seq-concatenate type sequences))
 
 ;;; List functions.
 
diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el
index 0b946dd736..629a7a5fb3 100644
--- a/lisp/emacs-lisp/seq.el
+++ b/lisp/emacs-lisp/seq.el
@@ -285,7 +285,11 @@ seq-concatenate
 TYPE must be one of following symbols: vector, string or list.
 
 \n(fn TYPE SEQUENCE...)"
-  (apply #'cl-concatenate type (seq-map #'seq-into-sequence sequences)))
+  (pcase type
+    ('vector (apply #'vconcat sequences))
+    ('string (apply #'concat sequences))
+    ('list (apply #'append (append sequences '(nil))))
+    (_ (error "Not a sequence type name: %S" type))))
 
 (cl-defgeneric seq-into-sequence (sequence)
   "Convert SEQUENCE into a sequence.
-- 
2.25.1






reply via email to

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