From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "John Wiegley" Newsgroups: gmane.emacs.devel Subject: Re: Can we add two args to copy-sequence? Date: Fri, 15 Dec 2017 22:18:38 -0800 Message-ID: References: <253aa3ee.50f5.160583aebc5.Coremail.netjune@163.com> <41cc6ca4.f2de.1605aa9400f.Coremail.netjune@163.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Trace: blaine.gmane.org 1513405177 20436 195.159.176.226 (16 Dec 2017 06:19:37 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 16 Dec 2017 06:19:37 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (darwin) Cc: Elias =?utf-8?Q?M=C3=A5rtenson?= , emacs-devel To: jun Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 16 07:19:30 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eQ5on-0004cY-BW for ged-emacs-devel@m.gmane.org; Sat, 16 Dec 2017 07:19:29 +0100 Original-Received: from localhost ([::1]:49537 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eQ5os-00017Q-TK for ged-emacs-devel@m.gmane.org; Sat, 16 Dec 2017 01:19:34 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51829) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eQ5ol-00017K-1E for emacs-devel@gnu.org; Sat, 16 Dec 2017 01:19:27 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eQ5oh-0002gY-TZ for emacs-devel@gnu.org; Sat, 16 Dec 2017 01:19:27 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:56925) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eQ5oW-0002Kb-T5; Sat, 16 Dec 2017 01:19:12 -0500 Original-Received: from auth2-smtp.messagingengine.com ([66.111.4.228]:47405) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.82) (envelope-from ) id 1eQ5oW-0000R2-Ke; Sat, 16 Dec 2017 01:19:12 -0500 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailauth.nyi.internal (Postfix) with ESMTP id E1CF620A7B; Sat, 16 Dec 2017 01:19:07 -0500 (EST) Original-Received: from frontend2 ([10.202.2.161]) by compute4.internal (MEProxy); Sat, 16 Dec 2017 01:19:07 -0500 X-ME-Sender: Original-Received: from localhost (76-234-69-149.lightspeed.frokca.sbcglobal.net [76.234.69.149]) by mail.messagingengine.com (Postfix) with ESMTPA id 79DD8244DF; Sat, 16 Dec 2017 01:19:07 -0500 (EST) In-Reply-To: <41cc6ca4.f2de.1605aa9400f.Coremail.netjune@163.com> (jun's message of "Fri, 15 Dec 2017 22:52:09 +0800 (CST)") Mail-Followup-To: jun , Elias =?utf-8?Q?M=C3=A5rtenson?= , emacs-devel X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:221119 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable >>>>> "j" =3D=3D jun writes: j> Yes, I just know subseq. And there are also seq-subseq, seq-take, seq-dr= op, j> butlast, Two many and hard to remmber. Almost all of them are implemented j> in lisp except copy-sequence which is in C. Some of them are implemented= by j> copying the whole sequence and then modify the copy. If we add the two a= rgs j> to copy-sequence, then these functions can be based on it with only one = or j> two lines in lisp, and reduce some data copy. Does the two args make j> copy-sequence too much complex internally? Ah, subseq, there it is. I kept looking for sublist or some variant thereof. It's not that it's too complex internally, it's that extracting a sublist is not the purpose of copy-sequence. You are asking us to add extra arguments = to a function to double its purpose, in a way that's more than just "copying a sequence", as the name implies. I'm very much against shoe-horning other behaviors into functions that appe= ar "close enough" for this sort of convenience. Please use cl-subseq. If we ne= ed to move subseq into C, that's a different request, and could be made on grounds of efficiency or speed. But I won't make copy-sequence more complex for this reason. =2D-=20 John Wiegley GPG fingerprint =3D 4710 CF98 AF9B 327B B80F http://newartisans.com 60E1 46C4 BD1A 7AC1 4BA2 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAEBCgAdFiEE3lW3afxXihSlvlQwwUTY9PGf5jAFAlo0ur4ACgkQwUTY9PGf 5jAkCwv9GX8moLOvP8Y60UWAa9gEtp/Uk2rRg10/8UThWuG6KTd9Bk7PbtWITGqv lierhArC9tbvH+d9RejdjNxJTpt8/OK+0inf9NEjqkAvKufJduyeGwbqw1IOafUE fD4kjB1C4CKMj4YUqOsJTaS8czYEn83TjBFIFdrBx+x8x9CGm53fTczIVSnWxqQc Xd4hQIVfblEiJhOEuJaj09fWqnE3CXtgpgGeNEIFme6KUs4c2+EHniIxuWfsmL65 sw3LBGaVpW2RFIP9oB/1M/x98zP7QxQT3ePxRhzyVfIMvmT+kmDlbrqd23mMRZea w7IEI7gocogrWybvdJNgtbWpKnzwDliq8m3PducN2rdJ2RQJSDDEa1A6+cbjwSmQ /I5l1HRnPxpAjDkyi2Mygowzl8pHjLk8oBHvO19b/In1HQv6HVZAXH4g13SInar7 S/HgdKhsiAUKTyaaKTVlFAVbCc69UoSs5y/IuuBfMw5Y2zXSHcSJymXGKuNgcpeY dqL5o/Nb =a4um -----END PGP SIGNATURE----- --=-=-=--