From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Andrew Eggenberger Newsgroups: gmane.emacs.bugs Subject: bug#39761: [PATCH] Eliminate use of cl-concatenate in 'seq' package Date: Thu, 27 Feb 2020 21:43:47 -0600 Message-ID: <20200228034347.35296-1-andrew.eggenberger@gmail.com> References: Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="11763"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Andrew Eggenberger To: 39761@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 28 05:13:12 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j7X1U-0002zI-EZ for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 28 Feb 2020 05:13:12 +0100 Original-Received: from localhost ([::1]:41514 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7X1T-0000sL-GM for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 27 Feb 2020 23:13:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41223) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7X1L-0000rz-94 for bug-gnu-emacs@gnu.org; Thu, 27 Feb 2020 23:13:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j7X1K-0001s0-6R for bug-gnu-emacs@gnu.org; Thu, 27 Feb 2020 23:13:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54541) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j7X1K-0001rl-3v for bug-gnu-emacs@gnu.org; Thu, 27 Feb 2020 23:13:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j7X1J-0007VR-VI for bug-gnu-emacs@gnu.org; Thu, 27 Feb 2020 23:13:01 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Andrew Eggenberger Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 28 Feb 2020 04:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39761 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 39761-submit@debbugs.gnu.org id=B39761.158286314228803 (code B ref 39761); Fri, 28 Feb 2020 04:13:01 +0000 Original-Received: (at 39761) by debbugs.gnu.org; 28 Feb 2020 04:12:22 +0000 Original-Received: from localhost ([127.0.0.1]:60514 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j7X0g-0007UU-4G for submit@debbugs.gnu.org; Thu, 27 Feb 2020 23:12:22 -0500 Original-Received: from mail-yw1-f42.google.com ([209.85.161.42]:46848) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j7WZH-0006lW-TA for 39761@debbugs.gnu.org; Thu, 27 Feb 2020 22:44:04 -0500 Original-Received: by mail-yw1-f42.google.com with SMTP id n1so1584936ywe.13 for <39761@debbugs.gnu.org>; Thu, 27 Feb 2020 19:44:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=VYESvJew1MY3FTAbv5lJeGKIpg0urUBrBfSwuCP5nxo=; b=rBaarVsmZC74jhvi/2xW4/X8DZ/KMxmPANkVhcrqkewphSR8sw0FhNmztmpVeDsk8V Vfj70hxzmh/jMG1xFGrPjsaTc+PpGzGTpE98y2N28uHsseeo+nSnX1ADtrassYB2LpvX r6ZZqIFcWPeFwyr3MKf5xSKQw5PkOBs8OCBMgyR5Id3ffnGqmgpw02ugf6EKQMnz10O9 yCq+WdtLKeACrVdviJem9X6bXeE51er3GeDrj8zRUWcCN6qpsFyX8YGn/vZDoFMp3uk7 duHgABrdIwqxc25AWGC4mslccdC4NGJeYa8gxJyVec3lskpS6/oWlv8zQUaIk7kr6E4a I+3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=VYESvJew1MY3FTAbv5lJeGKIpg0urUBrBfSwuCP5nxo=; b=FKeUy7ufJsIke8AQWX+w3n+u7VeR4EHK6Vj7/WSiS4547iv2mLz9P3ZAnF6ON2rQSE F+I7Ef7Kxa/bbMHVwLegpCWhDWGP64jzVCrfvyjrvw7yYCeb3Lh3XHbn2zC7YD2Ph5tl PfOA8AbPN+v5WAMN0qOfTnbOIHVrtJlONDpE9YN/GVpdYOrCyzbPrFI6Q7sSdEC61Hsc TY8diSqhnQmRLVwz72QA6ICjSHzG8OdeTRL7dS7VhmPDTBJ0xp0bbiedOFbDDytSEU5f igjHW1dcMG2rw3t34Ary+du5NOt3Flvzh1A2gcd/NSPmubRgofDaomzQJsqaWWWMIpXb 00hw== X-Gm-Message-State: APjAAAUSCPuRWNW0QtcaaoZETqCRI0VGNIjr0k4I3fwrx2Ho/WDkbdJ9 o8r7ObKeHf/xusM7t/g3241qCVHRvzU= X-Google-Smtp-Source: APXvYqx2MJiltp0m04WwyHTZjvkTB/vu7JccGT89zu/sI0XKw/acJXRCNikKVUk8uNKapBKjMjRaZA== X-Received: by 2002:a81:8803:: with SMTP id y3mr2749349ywf.338.1582861437167; Thu, 27 Feb 2020 19:43:57 -0800 (PST) Original-Received: from localhost.localdomain ([140.190.57.67]) by smtp.gmail.com with ESMTPSA id z39sm1899791ywj.77.2020.02.27.19.43.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Feb 2020 19:43:56 -0800 (PST) X-Mailer: git-send-email 2.25.1 X-Mailman-Approved-At: Thu, 27 Feb 2020 23:12:21 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:176550 Archived-At: 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