From unknown Mon Aug 18 14:21:48 2025 X-Loop: help-debbugs@gnu.org Subject: bug#16963: A patch to create a list-with-tail primitive. Resent-From: Demetrios Obenour Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 07 Mar 2014 16:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 16963 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 16963@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.139421085515718 (code B ref -1); Fri, 07 Mar 2014 16:48:02 +0000 Received: (at submit) by debbugs.gnu.org; 7 Mar 2014 16:47:35 +0000 Received: from localhost ([127.0.0.1]:55077 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WLxvq-00045R-EP for submit@debbugs.gnu.org; Fri, 07 Mar 2014 11:47:34 -0500 Received: from eggs.gnu.org ([208.118.235.92]:57384) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WLvIe-0007PI-TD for submit@debbugs.gnu.org; Fri, 07 Mar 2014 08:58:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WLvIW-0002iZ-2g for submit@debbugs.gnu.org; Fri, 07 Mar 2014 08:58:56 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_40,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:58013) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLvIV-0002iV-VK for submit@debbugs.gnu.org; Fri, 07 Mar 2014 08:58:47 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59070) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLvIN-0003I3-Hp for bug-gnu-emacs@gnu.org; Fri, 07 Mar 2014 08:58:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WLvIF-0002Mk-1m for bug-gnu-emacs@gnu.org; Fri, 07 Mar 2014 08:58:39 -0500 Received: from mail-qa0-x229.google.com ([2607:f8b0:400d:c00::229]:61567) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLvIE-0002MW-U0 for bug-gnu-emacs@gnu.org; Fri, 07 Mar 2014 08:58:30 -0500 Received: by mail-qa0-f41.google.com with SMTP id j5so4068989qaq.28 for ; Fri, 07 Mar 2014 05:58:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:date:content-type:mime-version :content-transfer-encoding; bh=5Z8xmups80R/SnV00vUqR8rZN2krjHNt0hE5yc2PLyQ=; b=GCOP3uOkQTFQdr9HuMhrGj5ErqnuLOTCAJUXxZxoRC+hlsboAs1rvGlccqA4ABMVOE 7T/H6zaIxXWhBj7rw8UKh8R/Em4ITuKAiJ6QJwxDa0ikkHmPD/OrmRHvsbSAar8Jpa06 a+IP+SWTkinOX8e8VrMAedTchDbmiWJUQ1p/0vw/ePovAFBBq3KhkbT5HrmXS+7mvff2 Y05DF5phnb3JGHWI8HnZEOMVi5SSiRepMghj29D+OwGzfXXRbshyvl0c0OO5iyTcTRAP kD39ZX5YJ72U3HxUnn3p1/d3ZIqEbVOj0jNXLpRdSPr6Wt+MZbiH34+94VLRAHY15wjE rLQw== X-Received: by 10.224.57.142 with SMTP id c14mr3219857qah.23.1394200710027; Fri, 07 Mar 2014 05:58:30 -0800 (PST) Received: from [192.168.200.131] (c-71-236-63-161.hsd1.tn.comcast.net. [71.236.63.161]) by mx.google.com with ESMTPSA id m74sm9997932qgd.14.2014.03.07.05.58.29 for (version=SSLv3 cipher=RC4-SHA bits=128/128); Fri, 07 Mar 2014 05:58:29 -0800 (PST) Message-ID: <1394200708.1710.4.camel@localhost.localdomain> From: Demetrios Obenour Date: Fri, 07 Mar 2014 08:58:28 -0500 Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4 (3.10.4-2.fc20) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Mailman-Approved-At: Fri, 07 Mar 2014 11:47:33 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) Since a comment in backquote.el said that backquote-list* needed to be a primitive, here is an implementation of it as one, under the name list-with-tail. === modified file 'src/alloc.c' --- src/alloc.c 2014-02-28 21:45:34 +0000 +++ src/alloc.c 2014-03-07 13:27:33 +0000 @@ -2593,6 +2593,26 @@ return val; } +DEFUN ("list-with-tail", Flist_with_tail, Slist_with_tail, 0, MANY, 0, + doc: /* Return a newly created list with specified arguments as elements, +except for the last argument, which becomes the tail of the list. +At least one argument is required. +usage: (list &rest OBJECTS &last TAIL) */) + (ptrdiff_t nargs, Lisp_Object *args) +{ + if (nargs == 0) + error ("Wrong number of arguments"); + register Lisp_Object val; + nargs--; + val = args[nargs]; + + while (nargs > 0) + { + nargs--; + val = Fcons (args[nargs], val); + } + return val; +} DEFUN ("make-list", Fmake_list, Smake_list, 2, 2, 0, doc: /* Return a newly created list of length LENGTH, with each element being INIT. */) @@ -6921,6 +6941,7 @@ defsubr (&Scons); defsubr (&Slist); + defsubr (&Slist_with_tail); defsubr (&Svector); defsubr (&Smake_byte_code); defsubr (&Smake_list); Change Log: This creates a built-in function, list-with-tail, that is identical to backquote-list*-function in backquote.el except that it is a primitive. This follows the suggestion made in a backquote.el Sincerely, Demetrios Obenour From unknown Mon Aug 18 14:21:48 2025 X-Loop: help-debbugs@gnu.org Subject: bug#16963: A patch to create a list-with-tail primitive. Resent-From: Stefan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Mar 2014 02:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16963 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Demetrios Obenour Cc: 16963@debbugs.gnu.org Received: via spool by 16963-submit@debbugs.gnu.org id=B16963.139571341414246 (code B ref 16963); Tue, 25 Mar 2014 02:11:01 +0000 Received: (at 16963) by debbugs.gnu.org; 25 Mar 2014 02:10:14 +0000 Received: from localhost ([127.0.0.1]:48278 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WSGof-0003hh-DA for submit@debbugs.gnu.org; Mon, 24 Mar 2014 22:10:13 -0400 Received: from chene.dit.umontreal.ca ([132.204.246.20]:57461) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WSGod-0003hU-1p for 16963@debbugs.gnu.org; Mon, 24 Mar 2014 22:10:11 -0400 Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id s2P2ARxQ017230; Mon, 24 Mar 2014 22:10:27 -0400 Received: by pastel.home (Postfix, from userid 20848) id 7AE4C600AF; Mon, 24 Mar 2014 22:10:08 -0400 (EDT) From: Stefan Message-ID: References: <1394200708.1710.4.camel@localhost.localdomain> Date: Mon, 24 Mar 2014 22:10:08 -0400 In-Reply-To: <1394200708.1710.4.camel@localhost.localdomain> (Demetrios Obenour's message of "Fri, 07 Mar 2014 08:58:28 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4891=0 X-NAI-Spam-Version: 2.3.0.9362 : core <4891> : inlines <642> : streams <1144133> : uri <1708982> X-Spam-Score: -1.9 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.9 (-) > Since a comment in backquote.el said that backquote-list* needed to be a > primitive, here is an implementation of it as one, under the name > list-with-tail. I think it would make more sense to call it `list*'. Also it might make sense to change backquote.el so it uses this `list*' (tho probably only when passed with enough arguments). Stefan From unknown Mon Aug 18 14:21:48 2025 X-Loop: help-debbugs@gnu.org Subject: bug#16963: A patch to create a list-with-tail primitive. Resent-From: Daniel Colascione Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Mar 2014 02:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16963 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Stefan , Demetrios Obenour Cc: 16963@debbugs.gnu.org Received: via spool by 16963-submit@debbugs.gnu.org id=B16963.139571551918091 (code B ref 16963); Tue, 25 Mar 2014 02:46:02 +0000 Received: (at 16963) by debbugs.gnu.org; 25 Mar 2014 02:45:19 +0000 Received: from localhost ([127.0.0.1]:48297 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WSHMc-0004hi-CG for submit@debbugs.gnu.org; Mon, 24 Mar 2014 22:45:18 -0400 Received: from dancol.org ([96.126.100.184]:42282) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WSHMY-0004hU-J3 for 16963@debbugs.gnu.org; Mon, 24 Mar 2014 22:45:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Type:In-Reply-To:References:Subject:CC:To:MIME-Version:From:Date:Message-ID; bh=1ORSYsMgOiyX9A8m5Ci1QOA30BFsc7FNg1wK/speG1M=; b=ScHoagx3NaRzw8VbCu1Zwad3QNDhl97EZdw1jkp/SCLVcZ3hLzeZ0Aj1x1Z4OW5UkDpbmlqSJstI7VeLtZXVXh3A8Je5thkbBGxFjRn/G8ZMMn7lWSXYvLqjR5M12lZrq1q+icJbU34pkbSXn3jLtOWUpjq1gAglgEiwQ5OWnDrcQy5KZVztTrptCCoGtN/zEqetFGm4d/WYcIKX/kQQqVZcJTJgS4QUzAAt7zoWamwT6URsIlKoH7l8eZETRuFYt8EJI5khASXYgsj9MfMcmf5Pb2nLH6kn6lwYjH5EXeRxyCz7X8q8fxZtfG8pm85Wy3ZfFVIk3A9gtE7hoj9InA==; Received: from [2620:0:1cfe:a1:2b5:6dff:fe00:f9a6] by dancol.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1WSHMV-0002xy-U9; Mon, 24 Mar 2014 19:45:11 -0700 Message-ID: <5330EDB0.1070406@dancol.org> Date: Mon, 24 Mar 2014 19:45:04 -0700 From: Daniel Colascione User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 References: <1394200708.1710.4.camel@localhost.localdomain> In-Reply-To: X-Enigmail-Version: 1.6 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="q7rirHXgFVf487a4ApluSnpSN9XUq7xs3" X-Spam-Score: -0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --q7rirHXgFVf487a4ApluSnpSN9XUq7xs3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 03/24/2014 07:10 PM, Stefan wrote: >> Since a comment in backquote.el said that backquote-list* needed to be= a >> primitive, here is an implementation of it as one, under the name >> list-with-tail. >=20 > I think it would make more sense to call it `list*'. Also it might mak= e > sense to change backquote.el so it uses this `list*' (tho probably only= > when passed with enough arguments). Agreed. On more that one occasion, I've wished we had a CL-less `list*'. If you do add this feature, please make sure the existing list* compiler macros keep working. --q7rirHXgFVf487a4ApluSnpSN9XUq7xs3 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJTMO2wAAoJEMAaIROpHW7IORoQAIcNd/i3cZ7Sfig9Om4IMQ15 T3ibfcizBBnTR8RYo56j4HN0CkxkryF8J+WMrp7UKCQmYKvQR2gBUh3y+YTBdWhr a3lwQR3NVr12aXFnn2thhxf7YbTttMeJl2wid6bk29CBl0MXLd19lW4zE4zVW4Mx iApxhzugkVSUb3Y+Uxz6n0Ao4fCmh/WqmIDAxkDg5rz2B8T0bq56U4B22tC1DfP8 8zR/GG8687HDRdY12PiCHtKIzrtpETF+Tb2k2DeCTYfUbrClPQhkF5b26J0EOVbd Bbc3Tpvtnt1QZbq3KXWEg/S73LYTGsuaoTXKP7kA58Rmz9t0Acu0WHPGSWJpmnJA a3WUz8Q3NNxq5LygwOTb2XOVDTf6coOYx98p7rm8CG95xg8vO/lK3rwM2jQHgU0Q VcCaukluKoWfX91O7wENCu9Xx3sCJ5FK6vwtqqD2JESWiWXsPk26d246zz/lP2/4 o0SoHrbvTvJgXTpqgXmTLkR9nbFoTGARDHIIDdaq5a23dF/qOz6xC92G22ENZUfz ZMw8x8UZ2uQaRnbPqwrnsmlY8+hYoLtAP2mJ/i6tKzA8aSV1K563Pa9FMuWxoYjk ZJmhlYCqk7uUvkY6qBhEZZSVMSyu4qyHpYMjxnupYeM6luiFoE8JK3HMU+dqlUne b0B+zwQRhEBWMifqBxZH =ogJu -----END PGP SIGNATURE----- --q7rirHXgFVf487a4ApluSnpSN9XUq7xs3-- From unknown Mon Aug 18 14:21:48 2025 X-Loop: help-debbugs@gnu.org Subject: bug#16963: A patch to create a list-with-tail primitive. Resent-From: Demetrios Obenour Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 27 Mar 2014 23:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16963 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Daniel Colascione Cc: 16963@debbugs.gnu.org, Stefan Received: via spool by 16963-submit@debbugs.gnu.org id=B16963.139596345112726 (code B ref 16963); Thu, 27 Mar 2014 23:38:01 +0000 Received: (at 16963) by debbugs.gnu.org; 27 Mar 2014 23:37:31 +0000 Received: from localhost ([127.0.0.1]:53320 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WTJrX-0003JB-1x for submit@debbugs.gnu.org; Thu, 27 Mar 2014 19:37:31 -0400 Received: from mail-yk0-f175.google.com ([209.85.160.175]:57519) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WTJrU-0003Iy-89 for 16963@debbugs.gnu.org; Thu, 27 Mar 2014 19:37:28 -0400 Received: by mail-yk0-f175.google.com with SMTP id 131so3082415ykp.34 for <16963@debbugs.gnu.org>; Thu, 27 Mar 2014 16:37:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:cc:date:in-reply-to:references :content-type:mime-version:content-transfer-encoding; bh=rMcwOFtJpftnNlnKuoCpaZI225vM9Mu8XhRqHTvHJuI=; b=Oi98+h6T9lf/QkHcSJ/qnY+3FMR9ZEgp57hEUwYBMiJFZ896slsEjGf6/U6xd2ZXLS v6AzFU3kfslPfm91uSESWyy1NvxgSjXdt9K9GlrGTQKEvxWB0/dKkdb0gHT3O14rjX6C IxDbQlp6xt946j76FBtnvnwijSuqcBUm4il8g5YGnrtOx+OaHyTgMdjJQoxPzublyC/c v9cjG00Xm9qSPLE0xcBs/pjvBLUzH1n2TOZI2QWY7pnsRko4lE4kaDEtc4TWiGgyvOHL im7RbwBJYNGoZrYSALeEPjw4qyT/ZubzZ3EO4wYihBSsUUTgitaf9poIdCAZIypUo7B2 GIuw== X-Received: by 10.236.190.100 with SMTP id d64mr6498457yhn.76.1395963447529; Thu, 27 Mar 2014 16:37:27 -0700 (PDT) Received: from [192.168.200.131] (c-71-236-63-161.hsd1.tn.comcast.net. [71.236.63.161]) by mx.google.com with ESMTPSA id y9sm5872742yhc.40.2014.03.27.16.37.26 for (version=SSLv3 cipher=RC4-SHA bits=128/128); Thu, 27 Mar 2014 16:37:26 -0700 (PDT) Message-ID: <1395963445.1956.2.camel@localhost.localdomain> From: Demetrios Obenour Date: Thu, 27 Mar 2014 19:37:25 -0400 In-Reply-To: <5330EDB0.1070406@dancol.org> References: <1394200708.1710.4.camel@localhost.localdomain> <5330EDB0.1070406@dancol.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4 (3.10.4-2.fc20) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Mon, 2014-03-24 at 19:45 -0700, Daniel Colascione wrote: > On 03/24/2014 07:10 PM, Stefan wrote: > >> Since a comment in backquote.el said that backquote-list* needed to be a > >> primitive, here is an implementation of it as one, under the name > >> list-with-tail. > > > > I think it would make more sense to call it `list*'. Also it might make > > sense to change backquote.el so it uses this `list*' (tho probably only > > when passed with enough arguments). > > Agreed. On more that one occasion, I've wished we had a CL-less `list*'. > If you do add this feature, please make sure the existing list* compiler > macros keep working. > What about just deleting these compiler macros, and making cl-list* an alias for list*? There seems to be little point in keeping them if list* is a primitive. From unknown Mon Aug 18 14:21:48 2025 X-Loop: help-debbugs@gnu.org Subject: bug#16963: A patch to create a list-with-tail primitive. Resent-From: Daniel Colascione Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 27 Mar 2014 23:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16963 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Demetrios Obenour Cc: 16963@debbugs.gnu.org, Stefan Received: via spool by 16963-submit@debbugs.gnu.org id=B16963.139596351412846 (code B ref 16963); Thu, 27 Mar 2014 23:39:02 +0000 Received: (at 16963) by debbugs.gnu.org; 27 Mar 2014 23:38:34 +0000 Received: from localhost ([127.0.0.1]:53324 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WTJsX-0003L8-NP for submit@debbugs.gnu.org; Thu, 27 Mar 2014 19:38:34 -0400 Received: from dancol.org ([96.126.100.184]:60386) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WTJsU-0003Kw-Ha for 16963@debbugs.gnu.org; Thu, 27 Mar 2014 19:38:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Type:In-Reply-To:References:Subject:CC:To:MIME-Version:From:Date:Message-ID; bh=EjjbTksFQWGVRhvJ/4xlH+nfziSDYONR41xIHG+ehko=; b=ZZZ9rqFNrRAS/M1Pujxgth7lPGmxWD7nRASIxs5a45sPdu44jxk4PEIqUkIFvryuQoqVfLSpFwe+ZylwMl41iW0BXdmvdiwGxGlF5wlZSwfzn1CUJm51sdANA7l+wdAe+4pnzYhYD+vkjxdaLCbT/B51sVt/EIZQnxp0LguuVBQffgxafYQRGYt0uF5CPhsIk6SYNMzyDsz0VECnAkHoVrMEb2sdLzWndXUOex0g3xC2IhfMtWAdm0JpNMPu6Lhr6b4ot/jNXydW2BV9f/q6rSEH0PJwzAQSIYeah+JT2SPe6NMo3GLJY3wuthmUL3UwVbn7EnIYdBHgi7xRADIxMA==; Received: from [8.22.9.108] (helo=[10.128.20.12]) by dancol.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1WTJsR-0002ar-5d; Thu, 27 Mar 2014 16:38:27 -0700 Message-ID: <5334B66A.1040908@dancol.org> Date: Thu, 27 Mar 2014 16:38:18 -0700 From: Daniel Colascione User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 References: <1394200708.1710.4.camel@localhost.localdomain> <5330EDB0.1070406@dancol.org> <1395963445.1956.2.camel@localhost.localdomain> In-Reply-To: <1395963445.1956.2.camel@localhost.localdomain> X-Enigmail-Version: 1.6 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="o63UoUp51TBavDpsoE3chbWcdGdxdoU0U" X-Spam-Score: -0.4 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --o63UoUp51TBavDpsoE3chbWcdGdxdoU0U Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 03/27/2014 04:37 PM, Demetrios Obenour wrote: > On Mon, 2014-03-24 at 19:45 -0700, Daniel Colascione wrote: >> On 03/24/2014 07:10 PM, Stefan wrote: >>>> Since a comment in backquote.el said that backquote-list* needed to = be a >>>> primitive, here is an implementation of it as one, under the name >>>> list-with-tail. >>> >>> I think it would make more sense to call it `list*'. Also it might m= ake >>> sense to change backquote.el so it uses this `list*' (tho probably on= ly >>> when passed with enough arguments). >> >> Agreed. On more that one occasion, I've wished we had a CL-less `list*= '. >> If you do add this feature, please make sure the existing list* compil= er >> macros keep working. >> > What about just deleting these compiler macros, and making cl-list* an > alias for list*? >=20 > There seems to be little point in keeping them if list* is a primitive.= The new list* doesn't have an opcode, but cons does. --o63UoUp51TBavDpsoE3chbWcdGdxdoU0U Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJTNLZqAAoJEMAaIROpHW7IV0AP/007388BQT394pjlYlvYjNl5 +xRIcQV2scUjoJ0m6w+uf5+6QcyYUMMUrD4/oQLoHWUJFnIFPn0fNIbz9mYSOAwA r0IITz/SPbbVkVGVvc2QfoWjfdQRS/crzbeqtgqQSAbAd03YWSJ4HB008aZd4F7w qmu9Z6+LIt/XPB08HK2pkaHcY1ei6I+DzXmp8gVnWZO2HGmsI5rdM8LVNFNsd4ow 3BI4H0wSE1AZIXHDPnQUKe4o2/6yFvrFgzBrVzBYNy+1qeC7M0X5NHkjyeIXoKAu Kh9DbCBM646t9dK3N1081eGf0jQyIcv95/fNnS0wKnOBleTCJA+JowS+1iwTjW0U 6uYXbmTLRm3I5foAXL2c0bnp+Vqmq7M3+yO3YDKCl3oBvdGBH3+vpjN3AG4drGhc xz929RamGnIjMsfLwC8GjaTMqyCOHO2XPgc0uknpJ4v6V/fYZOmjWDjMpb+qzoIO I1tthfrTgK9t2sH8Irpxn73vpptYxpalEHcMP6/9r1iOXq1u68f0uUSNw8vJHqqy t9tNUMwB4V/i2CV9Fee74ObIvy/6/KyUBOJDOiXT6Jj3jiYvs45fbJwvJZ+rx3Dl W4I0o4FofgCwCAvvtWeO6J95YhB36sk+tErxgrHdoT+RdKC3Xot5bWwwnTC4wD63 hwM/MRPUv3gdDptZ+eTV =fk/V -----END PGP SIGNATURE----- --o63UoUp51TBavDpsoE3chbWcdGdxdoU0U-- From unknown Mon Aug 18 14:21:48 2025 X-Loop: help-debbugs@gnu.org Subject: bug#16963: A patch to create a list-with-tail primitive. Resent-From: Demetrios Obenour Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 28 Mar 2014 00:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16963 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Daniel Colascione Cc: 16963@debbugs.gnu.org, Stefan Received: via spool by 16963-submit@debbugs.gnu.org id=B16963.139596743423854 (code B ref 16963); Fri, 28 Mar 2014 00:44:02 +0000 Received: (at 16963) by debbugs.gnu.org; 28 Mar 2014 00:43:54 +0000 Received: from localhost ([127.0.0.1]:53388 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WTKtl-0006Ce-Qx for submit@debbugs.gnu.org; Thu, 27 Mar 2014 20:43:54 -0400 Received: from mail-yk0-f176.google.com ([209.85.160.176]:33218) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WTKth-0006CQ-TA for 16963@debbugs.gnu.org; Thu, 27 Mar 2014 20:43:50 -0400 Received: by mail-yk0-f176.google.com with SMTP id 19so3071415ykq.7 for <16963@debbugs.gnu.org>; Thu, 27 Mar 2014 17:43:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:cc:date:in-reply-to:references :content-type:mime-version:content-transfer-encoding; bh=jotlQkCz0X57GiRmV8K8Njj5sEtCSiQP19Y+EnLd9Kw=; b=vy8346Q/nnLCMDOzeJNx893P0C99zYwgeI1wyKUcD2QmwhMUdn3pSjT04Hs+QA2uyH GvbfO3aQAfPHR4bXf6O1zZ0Mgc153Xwtpe9BAa9DpMVP2mh/qe+yNORbWhpH0f6veIMR BeXjO2SrIB9LUGMO6tan5lavpDV9YgfnhalpiUcQf5b8xiog7j+gjOhSBOpcxXtHpgFB sRY4gwPSoTMWVxX+leinuXkVIpeBX6aE2iPpdsqzrbfEPux/qUhj/O1cpYc9vk82Pz0m PsdGnDBaojaq4cODC0a3Ws9Q8XY77hSFxFt6wD1plahMsdeqnL6J5FuFIfR4LlS/tW+m yJew== X-Received: by 10.236.116.131 with SMTP id g3mr49718yhh.110.1395967429221; Thu, 27 Mar 2014 17:43:49 -0700 (PDT) Received: from [192.168.200.131] (c-71-236-63-161.hsd1.tn.comcast.net. [71.236.63.161]) by mx.google.com with ESMTPSA id k23sm6129413yhj.45.2014.03.27.17.43.48 for (version=SSLv3 cipher=RC4-SHA bits=128/128); Thu, 27 Mar 2014 17:43:48 -0700 (PDT) Message-ID: <1395967427.1853.1.camel@localhost.localdomain> From: Demetrios Obenour Date: Thu, 27 Mar 2014 20:43:47 -0400 In-Reply-To: <5334B66A.1040908@dancol.org> References: <1394200708.1710.4.camel@localhost.localdomain> <5330EDB0.1070406@dancol.org> <1395963445.1956.2.camel@localhost.localdomain> <5334B66A.1040908@dancol.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4 (3.10.4-2.fc20) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Thu, 2014-03-27 at 16:38 -0700, Daniel Colascione wrote: > On 03/27/2014 04:37 PM, Demetrios Obenour wrote: > > On Mon, 2014-03-24 at 19:45 -0700, Daniel Colascione wrote: > >> On 03/24/2014 07:10 PM, Stefan wrote: > >>>> Since a comment in backquote.el said that backquote-list* needed to be a > >>>> primitive, here is an implementation of it as one, under the name > >>>> list-with-tail. > >>> > >>> I think it would make more sense to call it `list*'. Also it might make > >>> sense to change backquote.el so it uses this `list*' (tho probably only > >>> when passed with enough arguments). > >> > >> Agreed. On more that one occasion, I've wished we had a CL-less `list*'. > >> If you do add this feature, please make sure the existing list* compiler > >> macros keep working. > >> > > What about just deleting these compiler macros, and making cl-list* an > > alias for list*? > > > > There seems to be little point in keeping them if list* is a primitive. > > The new list* doesn't have an opcode, but cons does. > Ah I see -- there might be a speed advantage in repeated cons calls, up to a point. At what point would the function look-up be slower than repeated function calls (I thought that function calls in Emacs Lisp are slow)? From unknown Mon Aug 18 14:21:48 2025 X-Loop: help-debbugs@gnu.org Subject: bug#16963: A patch to create a list-with-tail primitive. Resent-From: Demetrios Obenour Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 29 Mar 2014 01:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16963 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Daniel Colascione Cc: 16963@debbugs.gnu.org, Stefan Received: via spool by 16963-submit@debbugs.gnu.org id=B16963.139605762423880 (code B ref 16963); Sat, 29 Mar 2014 01:48:01 +0000 Received: (at 16963) by debbugs.gnu.org; 29 Mar 2014 01:47:04 +0000 Received: from localhost ([127.0.0.1]:55267 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WTiMR-0006D6-Tn for submit@debbugs.gnu.org; Fri, 28 Mar 2014 21:47:04 -0400 Received: from mail-yh0-f43.google.com ([209.85.213.43]:45731) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WTiMP-0006Ca-0R for 16963@debbugs.gnu.org; Fri, 28 Mar 2014 21:47:01 -0400 Received: by mail-yh0-f43.google.com with SMTP id b6so5710951yha.30 for <16963@debbugs.gnu.org>; Fri, 28 Mar 2014 18:47:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:cc:date:in-reply-to:references :content-type:mime-version; bh=3VfmplPWpS01JC4XwxiZq3+rqE3zLenurKvATfuQcQ8=; b=JLoD7gMhf5gP0iwHAUKDDvfluV8wWbxdgaCWNPbbfbP3m0tC3e9GL/f4P80k0zFqu9 SGpGwtgt9SEtGNe0EZjXYc2+JyID7adX5Y/1VT+9We8R5EGCITY3/EOrdxtCJz8UuhqM WNrILEIh//jM06Bd4FnUo0dJG5m5vsBBFRYoGCEPJUnjzapUYKqToUqXTtlsoAndCBxq s42q8ijl09ZujLfZ7yx8NxIqpgvcVbYQipEMYy5sf+yeXq+D9ycsnlHLp57QPpmGlV63 UeesHl7enLmiDyMvJblX9h6FVGsQniLRc5QREv8UUoFhgW8WYUHKZ2C9eo3NraKEl9v5 NlvA== X-Received: by 10.236.206.7 with SMTP id k7mr16587728yho.84.1396057620397; Fri, 28 Mar 2014 18:47:00 -0700 (PDT) Received: from [192.168.200.131] (c-71-236-63-161.hsd1.tn.comcast.net. [71.236.63.161]) by mx.google.com with ESMTPSA id s6sm1775562yho.45.2014.03.28.18.46.59 for (version=SSLv3 cipher=RC4-SHA bits=128/128); Fri, 28 Mar 2014 18:46:59 -0700 (PDT) Message-ID: <1396057618.8469.0.camel@localhost.localdomain> From: Demetrios Obenour Date: Fri, 28 Mar 2014 21:46:58 -0400 In-Reply-To: <5334B66A.1040908@dancol.org> References: <1394200708.1710.4.camel@localhost.localdomain> <5330EDB0.1070406@dancol.org> <1395963445.1956.2.camel@localhost.localdomain> <5334B66A.1040908@dancol.org> Content-Type: multipart/alternative; boundary="=-Yc4sXwmChzmG24MqZFEd" X-Mailer: Evolution 3.10.4 (3.10.4-2.fc20) Mime-Version: 1.0 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --=-Yc4sXwmChzmG24MqZFEd Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit On Thu, 2014-03-27 at 16:38 -0700, Daniel Colascione wrote: > On 03/27/2014 04:37 PM, Demetrios Obenour wrote: > > On Mon, 2014-03-24 at 19:45 -0700, Daniel Colascione wrote: > >> On 03/24/2014 07:10 PM, Stefan wrote: > >>>> Since a comment in backquote.el said that backquote-list* needed to be a > >>>> primitive, here is an implementation of it as one, under the name > >>>> list-with-tail. > >>> > >>> I think it would make more sense to call it `list*'. Also it might make > >>> sense to change backquote.el so it uses this `list*' (tho probably only > >>> when passed with enough arguments). > >> > >> Agreed. On more that one occasion, I've wished we had a CL-less `list*'. > >> If you do add this feature, please make sure the existing list* compiler > >> macros keep working. > >> > > What about just deleting these compiler macros, and making cl-list* an > > alias for list*? > > > > There seems to be little point in keeping them if list* is a primitive. > > The new list* doesn't have an opcode, but cons does. > Good point! My testing showed four nested cons calls to be much faster than list* with five arguments by several dozen times. Maybe list* should be a macro instead? --=-Yc4sXwmChzmG24MqZFEd Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: 7bit
On Thu, 2014-03-27 at 16:38 -0700, Daniel Colascione wrote:
> On 03/27/2014 04:37 PM, Demetrios Obenour wrote:
> > On Mon, 2014-03-24 at 19:45 -0700, Daniel Colascione wrote:
> >> On 03/24/2014 07:10 PM, Stefan wrote:
> >>>> Since a comment in backquote.el said that backquote-list* needed to be a
> >>>> primitive, here is an implementation of it as one, under the name
> >>>> list-with-tail.
> >>>
> >>> I think it would make more sense to call it `list*'.  Also it might make
> >>> sense to change backquote.el so it uses this `list*' (tho probably only
> >>> when passed with enough arguments).
> >>
> >> Agreed. On more that one occasion, I've wished we had a CL-less `list*'.
> >> If you do add this feature, please make sure the existing list* compiler
> >> macros keep working.
> >>
> > What about just deleting these compiler macros, and making cl-list* an
> > alias for list*?
> > 
> > There seems to be little point in keeping them if list* is a primitive.
> 
> The new list* doesn't have an opcode, but cons does.
> 
Good point! My testing showed four nested cons calls to be much faster
than list* with five arguments by several dozen times.

Maybe list* should be a macro instead?

--=-Yc4sXwmChzmG24MqZFEd-- From unknown Mon Aug 18 14:21:48 2025 X-Loop: help-debbugs@gnu.org Subject: bug#16963: A patch to create a list-with-tail primitive. Resent-From: Daniel Colascione Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 29 Mar 2014 01:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16963 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Demetrios Obenour Cc: 16963@debbugs.gnu.org, Stefan Received: via spool by 16963-submit@debbugs.gnu.org id=B16963.139605771124026 (code B ref 16963); Sat, 29 Mar 2014 01:49:02 +0000 Received: (at 16963) by debbugs.gnu.org; 29 Mar 2014 01:48:31 +0000 Received: from localhost ([127.0.0.1]:55271 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WTiNq-0006FS-OQ for submit@debbugs.gnu.org; Fri, 28 Mar 2014 21:48:31 -0400 Received: from dancol.org ([96.126.100.184]:39170) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WTiNn-0006FG-9U for 16963@debbugs.gnu.org; Fri, 28 Mar 2014 21:48:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Type:In-Reply-To:References:Subject:CC:To:MIME-Version:From:Date:Message-ID; bh=9CXOU6eUR1SxyVayH7wudaGFgGMkIgKuW5yc3NWtTQ0=; b=iDDY8NsBzFiGtzHVp9AkK95IXBoEYyjk0A5wX0+Fjq9vGLFKR+rQ2pnmIXeAA2p+o2F75ldE15f9W4mQCG+SdJb7HjxhHAOW6Vy4fkO31MjiC9y2qyz8DtkCdoeib3GBgidv7XWax5wwSyCj6bXbb9T8Zjcjiq1k4x/rh4ftl9QZLIOo5HcZa8o0pkEmE14KEGdVWjTrie377bFtNXD+Y1BJ178Xxkxw9Q49Mo46t2PYNIk6d3QDAgxfX+2+cOOHAo3wBiqeeUGZKELyYKuARwTDE3dpgZwiQ22qIk/y9tCloiryGkYmhHuDl/InYOeSm9PC2/QFSSgsKJRigdm1+A==; Received: from ip-64-134-226-73.public.wayport.net ([64.134.226.73] helo=[192.168.5.69]) by dancol.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1WTiNk-0000ww-1f; Fri, 28 Mar 2014 18:48:24 -0700 Message-ID: <53362659.8030106@dancol.org> Date: Fri, 28 Mar 2014 18:48:09 -0700 From: Daniel Colascione User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 References: <1394200708.1710.4.camel@localhost.localdomain> <5330EDB0.1070406@dancol.org> <1395963445.1956.2.camel@localhost.localdomain> <5334B66A.1040908@dancol.org> <1396057618.8469.0.camel@localhost.localdomain> In-Reply-To: <1396057618.8469.0.camel@localhost.localdomain> X-Enigmail-Version: 1.6 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="EwC8ngmkbcMmwcOTmijqPguqp7rCK93Om" X-Spam-Score: -0.4 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --EwC8ngmkbcMmwcOTmijqPguqp7rCK93Om Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 03/28/2014 06:46 PM, Demetrios Obenour wrote: > On Thu, 2014-03-27 at 16:38 -0700, Daniel Colascione wrote: >> On 03/27/2014 04:37 PM, Demetrios Obenour wrote: >> > On Mon, 2014-03-24 at 19:45 -0700, Daniel Colascione wrote: >> >> On 03/24/2014 07:10 PM, Stefan wrote: >> >>>> Since a comment in backquote.el said that backquote-list* needed = to be a >> >>>> primitive, here is an implementation of it as one, under the name= >> >>>> list-with-tail. >> >>> >> >>> I think it would make more sense to call it `list*'. Also it migh= t make >> >>> sense to change backquote.el so it uses this `list*' (tho probably= only >> >>> when passed with enough arguments). >> >> >> >> Agreed. On more that one occasion, I've wished we had a CL-less `li= st*'. >> >> If you do add this feature, please make sure the existing list* com= piler >> >> macros keep working. >> >> >> > What about just deleting these compiler macros, and making cl-list* = an >> > alias for list*? >> >=20 >> > There seems to be little point in keeping them if list* is a primiti= ve. >>=20 >> The new list* doesn't have an opcode, but cons does. >>=20 > Good point! My testing showed four nested cons calls to be much faster > than list* with five arguments by several dozen times. >=20 > Maybe list* should be a macro instead? No, list* as a function is perfectly fine --- we might want to call it indirectly sometimes, e.g., with apply. The compiler macro is sufficient to convert it to cons calls when we know it's safe. M-x disassemble is your friend. :-) --EwC8ngmkbcMmwcOTmijqPguqp7rCK93Om Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJTNiZZAAoJEMAaIROpHW7IaksQAI21i8FVEOuWWb/35KhGwRcH nwIL3oplY/zwhSGvrLVhkF9q90gtI1UWFlnldBlAZTbJHJZsUmTnoh/DJ7tIAn7+ OXA7mJ3Po4IJcPdoEsxPy2aN+j8wk0hS2tTS4qpradO8EeXIRnrwzcLy4/ypdPJa PpvoAt/jvPrnKo2LE1OaZOqb+Xnn7ee3rCFVJSN3aMUBh4R6XCkQx1IxvtxOdI6X OaAGp7DG5AvhNgrH9AT8qcLfo/MnLqjnO5DrjliBLYbZySXNIJh5QBWHZms0SQBN llkS6r6KJYQmCT96wuf1SuZGfo6/swPcoi+vqeodyz9vF1Srur/CbrkjitjdcI75 /snLwFyf3TmejpBv19/JPEADxU2TUCgUtxMjounQBsoU3wq6zsKKE4Dht4+GxMoe bdo9CvpdiLzJQuf5F+LujwvGWTATS2BWWlmdlmBs/tFe6nVtp9PURKf6C/pzt6fc dD6IuC5immnlziAQZS3Ka5FBamdiwD+3vPkhipagfelJuN82toURkbysgKw+GW+f xfN6mt0x11AJ4+KJb3Uhh+plgKC42feE0d87ukjGjUIqVgMEdXJyOx0nE+M5P8yL MOGWICHvAYxJ8G9y5BIaL8vPlZaHss8wwzg2cFW2PErEaAYybPYN0hO6Zhq7pgJv Zwvh3IkhmTDBgDPU5JMr =H8wi -----END PGP SIGNATURE----- --EwC8ngmkbcMmwcOTmijqPguqp7rCK93Om-- From unknown Mon Aug 18 14:21:48 2025 X-Loop: help-debbugs@gnu.org Subject: bug#16963: A patch to create a list-with-tail primitive. Resent-From: Demetrios Obenour Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 29 Mar 2014 13:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16963 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Daniel Colascione Cc: 16963@debbugs.gnu.org, Stefan Received: via spool by 16963-submit@debbugs.gnu.org id=B16963.13960998688080 (code B ref 16963); Sat, 29 Mar 2014 13:32:02 +0000 Received: (at 16963) by debbugs.gnu.org; 29 Mar 2014 13:31:08 +0000 Received: from localhost ([127.0.0.1]:55530 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WTtLl-000256-UV for submit@debbugs.gnu.org; Sat, 29 Mar 2014 09:31:07 -0400 Received: from mail-yh0-f46.google.com ([209.85.213.46]:54051) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WTtLe-00020G-LM for 16963@debbugs.gnu.org; Sat, 29 Mar 2014 09:30:59 -0400 Received: by mail-yh0-f46.google.com with SMTP id b6so6043885yha.5 for <16963@debbugs.gnu.org>; Sat, 29 Mar 2014 06:30:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:cc:date:in-reply-to:references :content-type:mime-version:content-transfer-encoding; bh=ZEm6+av7oMtNed8VSe1Bdbaisu3qZ6dNDQGbftjQzHk=; b=X5dLe9K9oST7PriI2YHMQBrnzte+5nBi0Xiwl9e16hZ5Y/vdHI5rbqKPnhhq2Vpot5 tjKBM4Z7COV18jljE06juGhwQoFJ5ux7NXj241VYllfU5Y6+c+eNeCs0ULLeUKEBdcoh /jHM8IbCpiE8K/SSASXlFQhFNRQpLoDHCfP4tahYKjo4/Ly5KpDrI486CLidsWm96cwU VFZgJyT4HPsukmIQ0QXTXzT4cRkHd+9Cg8+sw6Q6xmSY3nQucba6YF7SThQPVAVQedj5 hCRfahxL0DBVvOzuxk2s5j4Jet5Qd+APblixyohzYZamnwGh78NtnZWAM5dzbOA9eIh6 6Lrw== X-Received: by 10.236.203.101 with SMTP id e65mr814876yho.156.1396099857749; Sat, 29 Mar 2014 06:30:57 -0700 (PDT) Received: from [192.168.200.131] (c-71-236-63-161.hsd1.tn.comcast.net. [71.236.63.161]) by mx.google.com with ESMTPSA id t44sm14219926yhc.6.2014.03.29.06.30.56 for (version=SSLv3 cipher=RC4-SHA bits=128/128); Sat, 29 Mar 2014 06:30:57 -0700 (PDT) Message-ID: <1396099856.8469.3.camel@localhost.localdomain> From: Demetrios Obenour Date: Sat, 29 Mar 2014 09:30:56 -0400 In-Reply-To: <53362659.8030106@dancol.org> References: <1394200708.1710.4.camel@localhost.localdomain> <5330EDB0.1070406@dancol.org> <1395963445.1956.2.camel@localhost.localdomain> <5334B66A.1040908@dancol.org> <1396057618.8469.0.camel@localhost.localdomain> <53362659.8030106@dancol.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4 (3.10.4-2.fc20) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Fri, 2014-03-28 at 18:48 -0700, Daniel Colascione wrote: > On 03/28/2014 06:46 PM, Demetrios Obenour wrote: > > On Thu, 2014-03-27 at 16:38 -0700, Daniel Colascione wrote: > >> On 03/27/2014 04:37 PM, Demetrios Obenour wrote: > >> > On Mon, 2014-03-24 at 19:45 -0700, Daniel Colascione wrote: > >> >> On 03/24/2014 07:10 PM, Stefan wrote: > >> >>>> Since a comment in backquote.el said that backquote-list* needed to be a > >> >>>> primitive, here is an implementation of it as one, under the name > >> >>>> list-with-tail. > >> >>> > >> >>> I think it would make more sense to call it `list*'. Also it might make > >> >>> sense to change backquote.el so it uses this `list*' (tho probably only > >> >>> when passed with enough arguments). > >> >> > >> >> Agreed. On more that one occasion, I've wished we had a CL-less `list*'. > >> >> If you do add this feature, please make sure the existing list* compiler > >> >> macros keep working. > >> >> > >> > What about just deleting these compiler macros, and making cl-list* an > >> > alias for list*? > >> > > >> > There seems to be little point in keeping them if list* is a primitive. > >> > >> The new list* doesn't have an opcode, but cons does. > >> > > Good point! My testing showed four nested cons calls to be much faster > > than list* with five arguments by several dozen times. > > > > Maybe list* should be a macro instead? > > No, list* as a function is perfectly fine --- we might want to call it > indirectly sometimes, e.g., with apply. The compiler macro is sufficient > to convert it to cons calls when we know it's safe. M-x disassemble is > your friend. :-) > Ah thanks! Here is a patch to fix the Lisp files to exploit a list* primitive. === modified file 'lisp/emacs-lisp/cl-lib.el' --- lisp/emacs-lisp/cl-lib.el 2014-01-01 07:43:34 +0000 +++ lisp/emacs-lisp/cl-lib.el 2014-03-29 13:12:10 +0000 @@ -527,19 +527,13 @@ ;; (while (consp (cdr x)) (pop x)) ;; x)) -(defun cl-list* (arg &rest rest) +(defalias 'cl-list* (symbol-function 'list*) "Return a new list with specified ARGs as elements, consed to last ARG. Thus, `(cl-list* A B C D)' is equivalent to `(nconc (list A B C) D)', or to `(cons A (cons B (cons C D)))'. -\n(fn ARG...)" - (declare (compiler-macro cl--compiler-macro-list*)) - (cond ((not rest) arg) - ((not (cdr rest)) (cons arg (car rest))) - (t (let* ((n (length rest)) - (copy (copy-sequence rest)) - (last (nthcdr (- n 2) copy))) - (setcdr last (car (cdr last))) - (cons arg copy))))) +\n(fn ARG...)") +(put 'list* 'compiler-macro #'cl--compiler-macro-list*) +(put 'cl-list* 'compiler-macro #'cl--compiler-macro-list*) (defun cl-ldiff (list sublist) "Return a copy of LIST with the tail SUBLIST removed." === modified file 'lisp/emacs-lisp/cl.el' --- lisp/emacs-lisp/cl.el 2014-01-01 07:43:34 +0000 +++ lisp/emacs-lisp/cl.el 2014-03-29 12:58:27 +0000 @@ -257,7 +257,6 @@ adjoin copy-list ldiff - list* cddddr cdddar cddadr From unknown Mon Aug 18 14:21:48 2025 X-Loop: help-debbugs@gnu.org Subject: bug#16963: A patch to create a list-with-tail primitive. Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 24 Feb 2016 02:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16963 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Demetrios Obenour Cc: 16963@debbugs.gnu.org Received: via spool by 16963-submit@debbugs.gnu.org id=B16963.14562823347507 (code B ref 16963); Wed, 24 Feb 2016 02:53:02 +0000 Received: (at 16963) by debbugs.gnu.org; 24 Feb 2016 02:52:14 +0000 Received: from localhost ([127.0.0.1]:41956 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aYPYk-0001x0-Le for submit@debbugs.gnu.org; Tue, 23 Feb 2016 21:52:14 -0500 Received: from hermes.netfonds.no ([80.91.224.195]:54310) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aYPYj-0001wr-7p for 16963@debbugs.gnu.org; Tue, 23 Feb 2016 21:52:13 -0500 Received: from cpe-60-225-211-161.nsw.bigpond.net.au ([60.225.211.161] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1aYPYK-00067X-0B; Wed, 24 Feb 2016 03:51:48 +0100 From: Lars Ingebrigtsen References: <1394200708.1710.4.camel@localhost.localdomain> Date: Wed, 24 Feb 2016 13:51:43 +1100 In-Reply-To: <1394200708.1710.4.camel@localhost.localdomain> (Demetrios Obenour's message of "Fri, 07 Mar 2014 08:58:28 -0500") Message-ID: <877fhuom68.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-MailScanner-ID: 1aYPYK-00067X-0B X-Netfonds-MailScanner: Found to be clean X-Netfonds-MailScanner-From: larsi@gnus.org MailScanner-NULL-Check: 1456887110.14518@G6UK/v0taE+FJhDRQTW6PA X-Spam-Status: No X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Demetrios Obenour writes: > Since a comment in backquote.el said that backquote-list* needed to be a > primitive, here is an implementation of it as one, under the name > list-with-tail. [...] > -(defun cl-list* (arg &rest rest) > +(defalias 'cl-list* (symbol-function 'list*) > "Return a new list with specified ARGs as elements, consed to last Reading this bug report, there seemed to be general agreement that Emacs should have `list*', and that `cl-list*' should be an alias for it, but these patches were not applied. I can't find your name in the Emacs copyright assignment file -- would you be willing to sign a copyright assignment to the FSF? And then, could you re-spin the patches, along with changes to the lispref manual as needed (and an etc/NEWS entry)? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Mon Aug 18 14:21:48 2025 X-Loop: help-debbugs@gnu.org Subject: bug#16963: A patch to create a list-with-tail primitive. Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 26 Jun 2019 14:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16963 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Demetrios Obenour Cc: 16963@debbugs.gnu.org Received: via spool by 16963-submit@debbugs.gnu.org id=B16963.156155943220509 (code B ref 16963); Wed, 26 Jun 2019 14:31:01 +0000 Received: (at 16963) by debbugs.gnu.org; 26 Jun 2019 14:30:32 +0000 Received: from localhost ([127.0.0.1]:36656 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hg8wP-0005Io-He for submit@debbugs.gnu.org; Wed, 26 Jun 2019 10:30:31 -0400 Received: from quimby.gnus.org ([80.91.231.51]:49748) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hg8wO-0005HE-FN for 16963@debbugs.gnu.org; Wed, 26 Jun 2019 10:30:28 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=stories) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hg8wH-0000im-Ez; Wed, 26 Jun 2019 16:30:27 +0200 From: Lars Ingebrigtsen References: <1394200708.1710.4.camel@localhost.localdomain> <877fhuom68.fsf@gnus.org> Date: Wed, 26 Jun 2019 16:30:21 +0200 In-Reply-To: <877fhuom68.fsf@gnus.org> (Lars Ingebrigtsen's message of "Wed, 24 Feb 2016 13:51:43 +1100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Lars Ingebrigtsen writes: > Reading this bug report, there seemed to be general agreement that Emacs > should have `list*', and that `cl-list*' should be an alias for it, but > these patches were not applied. > > I can't find [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Lars Ingebrigtsen writes: > Reading this bug report, there seemed to be general agreement that Emacs > should have `list*', and that `cl-list*' should be an alias for it, but > these patches were not applied. > > I can't find your name in the Emacs copyright assignment file -- would > you be willing to sign a copyright assignment to the FSF? I asked that three years ago, when the patch was already two years old, so I'm guessing that this is not going to happen, so I'm closing this bug report. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 26 10:30:39 2019 Received: (at control) by debbugs.gnu.org; 26 Jun 2019 14:30:39 +0000 Received: from localhost ([127.0.0.1]:36659 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hg8wY-0005R4-VO for submit@debbugs.gnu.org; Wed, 26 Jun 2019 10:30:39 -0400 Received: from quimby.gnus.org ([80.91.231.51]:49762) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hg8wW-0005Ou-VP for control@debbugs.gnu.org; Wed, 26 Jun 2019 10:30:37 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=stories) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hg8wU-0000it-Cv for control@debbugs.gnu.org; Wed, 26 Jun 2019 16:30:36 +0200 Date: Wed, 26 Jun 2019 16:30:34 +0200 Message-Id: To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #16963 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 16963 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) close 16963 quit From unknown Mon Aug 18 14:21:48 2025 X-Loop: help-debbugs@gnu.org Subject: bug#16963: A patch to create a list-with-tail primitive. Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 28 Jun 2019 03:15:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16963 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Lars Ingebrigtsen Cc: 16963@debbugs.gnu.org, Demetrios Obenour Received: via spool by 16963-submit@debbugs.gnu.org id=B16963.156169168224659 (code B ref 16963); Fri, 28 Jun 2019 03:15:01 +0000 Received: (at 16963) by debbugs.gnu.org; 28 Jun 2019 03:14:42 +0000 Received: from localhost ([127.0.0.1]:40162 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hghLV-0006Pe-Mq for submit@debbugs.gnu.org; Thu, 27 Jun 2019 23:14:42 -0400 Received: from mail-io1-f41.google.com ([209.85.166.41]:34291) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hghLS-0006PM-Te for 16963@debbugs.gnu.org; Thu, 27 Jun 2019 23:14:40 -0400 Received: by mail-io1-f41.google.com with SMTP id k8so9495511iot.1 for <16963@debbugs.gnu.org>; Thu, 27 Jun 2019 20:14:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=6L0P5pEERkjGOIsTj1qDHmZcweFS2aq6FpcGTg4vbvo=; b=NlY7suauwy2XN9zWiC9+9O0YjFFbcEy6E5YADZu6p1kUr0VhLkUKNI4LbkhC5yOIml 0Mf8cyc3OC5CFRJ2d68nweRu2iHruTXOBgUJ2Sy0qU8WCMub8meUrxl8rCk3VIWTyn1C dnVVUlPTdN3SYx4cQkmXq+ZUEX7IUm+c3e/9PnQzCTN7A2tk+xvxeD03/1q6DjkahKii s7+LSa88mSUEU1ldpc3b6DhekxrK1oPCQ7uUeqzBzmzQNP1xRHW8REuczFrI+sueHibV HVyyW8M42pEd0nKot7D4l94T0B9hObH4Maq6ScuZevFaWpuE2vCcjoaZ/GHe8jk4ExdY aKRA== 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:references:date:in-reply-to :message-id:user-agent:mime-version; bh=6L0P5pEERkjGOIsTj1qDHmZcweFS2aq6FpcGTg4vbvo=; b=CmVk1win2TOcIYmnl/zXeTIk+bj3gXLkblNNEFKebZstoGM3Z0rvqLHGnSaDm0D9B4 7bTFixgk4XNq44sZHycpCK+z5PCDMViBFDzf52zgtYgtsXgnk2zd9/4fpKbNp7OWgZlP FdAHGXLk2mN4JRdTGnSzI7FeqTLsJx1A2Nko+U48jE4qKnY1MVf/uLLwvZsz/D8YwkJa It+M2RxmOf+sa/mD2/RspaaylXNrv/41PKzR8Xu5dPYB9MBgJiAJ6qT+EGahUM86zWzx M3eGV2PI8Qq4TtVsLTUVRGEsmOu02BWzXa6gQckh9CtgOaIl2muiwsgUHG43z/Rtwl8T llDg== X-Gm-Message-State: APjAAAVATPFec+MpdHbrHqaqMX5/khWRHEfbXF3gdUk8p0cIIHGX7/n7 m1TFEetjx6SQVPde2+mra3dBOBKD X-Google-Smtp-Source: APXvYqxD6IgYDsAcsXGF7+qgGg8ml0s3pzdNtCXPt5WumoKVQpCyHsIgDS5Y+8NFvmtT0W5k8PSOtw== X-Received: by 2002:a05:6602:2252:: with SMTP id o18mr7928633ioo.63.1561691673151; Thu, 27 Jun 2019 20:14:33 -0700 (PDT) Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.gmail.com with ESMTPSA id y20sm815517ion.77.2019.06.27.20.14.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 27 Jun 2019 20:14:32 -0700 (PDT) From: Noam Postavsky References: <1394200708.1710.4.camel@localhost.localdomain> <877fhuom68.fsf@gnus.org> Date: Thu, 27 Jun 2019 23:14:31 -0400 In-Reply-To: (Lars Ingebrigtsen's message of "Wed, 26 Jun 2019 16:30:21 +0200") Message-ID: <87v9wq5rl4.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2.90 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Lars Ingebrigtsen writes: > Lars Ingebrigtsen writes: > >> Reading this bug report, there seemed to be general agreement that Emacs >> should have `list*', and that `cl-list*' should be an alias for it, but >> these patches were not applied. >> >> I can't find your name in the Emacs copyright assignment file -- would >> you be willing to sign a copyright assignment to the FSF? > > I asked that three years ago, when the patch was already two years old, > so I'm guessing that this is not going to happen, so I'm closing this > bug report. Oh, this reminds me I had started writing a patch for this. I used the name cons* instead of list* though, I always found it more logical: cons* is cons repeated, just like let* is let repeated. Let me dust it off: --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=0001-Implement-cons-as-a-C-subroutine-Bug-16963.patch Content-Description: patch >From e44291e055b167548a9b5166764e144644cc6291 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sun, 2 Jul 2017 17:44:02 -0400 Subject: [PATCH] Implement cons* as a C subroutine (Bug#16963) * src/alloc.c (Fcons_star): New subr. * doc/lispref/lists.texi (Building Lists): Document it. * etc/NEWS: Announce it. * lisp/emacs-lisp/cl-macs.el (cl--compiler-macro-list*): Move to... * lisp/subr.el (internal--compiler-macro-cons*): ...here, and rename. Set as compiler-macro for `cons*'. * lisp/emacs-lisp/backquote.el (backquote-list*-function) (backquote-list*-macro, backquote-list*): Remove. (backquote-listify): * lisp/emacs-lisp/byte-opt.el: * lisp/emacs-lisp/inline.el (inline--do-quote): * lisp/emacs-lisp/macroexp.el (macroexp--expand-all): Replace `backquote-list*' with `cons*'. * lisp/emacs-lisp/cl-lib.el (cl-list*): Make into alias for `cons*'. * lisp/emacs-lisp/macroexp.el (macroexp--expand-all): Change special case for `backquote-list*' macro to special case for `internal--compiler-macro-cons*' compiler-macro. --- doc/lispref/lists.texi | 18 +++++ etc/NEWS | 3 + lisp/emacs-lisp/backquote.el | 50 +------------- lisp/emacs-lisp/byte-opt.el | 2 +- lisp/emacs-lisp/cl-lib.el | 15 +--- lisp/emacs-lisp/cl-macs.el | 8 --- lisp/emacs-lisp/inline.el | 2 +- lisp/emacs-lisp/macroexp.el | 161 +++++++++++++++++++++---------------------- lisp/subr.el | 9 +++ src/alloc.c | 13 ++++ 10 files changed, 129 insertions(+), 152 deletions(-) diff --git a/doc/lispref/lists.texi b/doc/lispref/lists.texi index 746b4643c1..a398721c79 100644 --- a/doc/lispref/lists.texi +++ b/doc/lispref/lists.texi @@ -503,6 +503,24 @@ Building Lists @end example @end defun +@defun cons* object1 &rest objects +This function is similar to @code{list}, but instead of terminating +the returned list with @code{nil}, it uses the last argument instead. +This is mainly useful when adding several elements to a list, to avoid +having to call @code{cons} repeatedly. For example: + +@example +(setq list (cons* newelt1 newelt2 list)) +@end example + +is equivalent to + +@example +(setq list (cons newelt1 (cons newelt2 list))) +@end example + +@end defun + @defun make-list length object This function creates a list of @var{length} elements, in which each element is @var{object}. Compare @code{make-list} with diff --git a/etc/NEWS b/etc/NEWS index b1f1f7293a..06d5e93d02 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1862,6 +1862,9 @@ according to the given numeric value. ** 'condition-case' now accepts 't' to match any error symbol. +++ +** New subr 'cons*'. + ++++ ** New function 'proper-list-p'. Given a proper list as argument, this predicate returns its length; otherwise, it returns nil. 'format-proper-list-p' is now an obsolete diff --git a/lisp/emacs-lisp/backquote.el b/lisp/emacs-lisp/backquote.el index 5e72dc3b40..fd31d82728 100644 --- a/lisp/emacs-lisp/backquote.el +++ b/lisp/emacs-lisp/backquote.el @@ -29,56 +29,10 @@ ;; When it sees ,... inside such a backquote form, it generates (\, ...). ;; For ,@... it generates (\,@ ...). -;; This backquote will generate calls to the backquote-list* form. -;; Both a function version and a macro version are included. -;; The macro version is used by default because it is faster -;; and needs no run-time support. It should really be a subr. - ;;; Code: (provide 'backquote) -;; function and macro versions of backquote-list* - -(defun backquote-list*-function (first &rest list) - "Like `list' but the last argument is the tail of the new list. - -For example (backquote-list* \\='a \\='b \\='c) => (a b . c)" - ;; The recursive solution is much nicer: - ;; (if list (cons first (apply 'backquote-list*-function list)) first)) - ;; but Emacs is not very good at efficiently processing recursion. - (if list - (let* ((rest list) (newlist (cons first nil)) (last newlist)) - (while (cdr rest) - (setcdr last (cons (car rest) nil)) - (setq last (cdr last) - rest (cdr rest))) - (setcdr last (car rest)) - newlist) - first)) - -(defmacro backquote-list*-macro (first &rest list) - "Like `list' but the last argument is the tail of the new list. - -For example (backquote-list* \\='a \\='b \\='c) => (a b . c)" - ;; The recursive solution is much nicer: - ;; (if list (list 'cons first (cons 'backquote-list*-macro list)) first)) - ;; but Emacs is not very good at efficiently processing such things. - (setq list (nreverse (cons first list)) - first (car list) - list (cdr list)) - (if list - (let* ((second (car list)) - (rest (cdr list)) - (newlist (list 'cons second first))) - (while rest - (setq newlist (list 'cons (car rest) newlist) - rest (cdr rest))) - newlist) - first)) - -(defalias 'backquote-list* (symbol-function 'backquote-list*-macro)) - ;; A few advertised variables that control which symbols are used ;; to represent the backquote, unquote, and splice operations. (defconst backquote-backquote-symbol '\` @@ -219,7 +173,7 @@ backquote-process (cons (if (eq (car-safe expression) 'quote) 0 1) expression))))) ;; backquote-listify takes (tag . structure) pairs from backquote-process -;; and decides between append, list, backquote-list*, and cons depending +;; and decides between append, list, cons*, and cons depending ;; on which tags are in the list. (defun backquote-listify (list old-tail) @@ -242,7 +196,7 @@ backquote-listify (and (consp (car heads)) (eq (car (car heads)) backquote-splice-symbol))))) - (cons (if use-list* 'backquote-list* 'cons) + (cons (if use-list* 'cons* 'cons) (append heads (list tail)))) tail)) (t (cons 'list heads))))) diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 2e09601639..0e53ab85ec 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -1168,7 +1168,7 @@ byte-optimize-set buffer-substring byte-code-function-p capitalize car-less-than-car car cdr ceiling char-after char-before char-equal char-to-string char-width compare-strings - compare-window-configurations concat coordinates-in-window-p + compare-window-configurations concat cons* coordinates-in-window-p copy-alist copy-sequence copy-marker cos count-lines current-time-string current-time-zone decode-char diff --git a/lisp/emacs-lisp/cl-lib.el b/lisp/emacs-lisp/cl-lib.el index c51c70d317..2f1274b71e 100644 --- a/lisp/emacs-lisp/cl-lib.el +++ b/lisp/emacs-lisp/cl-lib.el @@ -434,19 +434,8 @@ 'cl-cddddr ;; (while (consp (cdr x)) (pop x)) ;; x)) -(defun cl-list* (arg &rest rest) - "Return a new list with specified ARGs as elements, consed to last ARG. -Thus, `(cl-list* A B C D)' is equivalent to `(nconc (list A B C) D)', or to -`(cons A (cons B (cons C D)))'. -\n(fn ARG...)" - (declare (compiler-macro cl--compiler-macro-list*)) - (cond ((not rest) arg) - ((not (cdr rest)) (cons arg (car rest))) - (t (let* ((n (length rest)) - (copy (copy-sequence rest)) - (last (nthcdr (- n 2) copy))) - (setcdr last (car (cdr last))) - (cons arg copy))))) +(defalias 'cl-list* 'cons*) +(function-put 'cl-list* 'compiler-macro #'internal--compiler-macro-cons*) (defun cl-ldiff (list sublist) "Return a copy of LIST with the tail SUBLIST removed." diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 54974ceb7d..18b6707655 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -62,14 +62,6 @@ cl--optimize-speed ;; functions can lead to recursive-loads that prevent the calls from ;; being optimized. -;;;###autoload -(defun cl--compiler-macro-list* (_form arg &rest others) - (let* ((args (reverse (cons arg others))) - (form (car args))) - (while (setq args (cdr args)) - (setq form `(cons ,(car args) ,form))) - form)) - ;; Note: `cl--compiler-macro-cXXr' has been copied to ;; `internal--compiler-macro-cXXr' in subr.el. If you amend either ;; one, you may want to amend the other, too. diff --git a/lisp/emacs-lisp/inline.el b/lisp/emacs-lisp/inline.el index 70dbff2147..25aee42db2 100644 --- a/lisp/emacs-lisp/inline.el +++ b/lisp/emacs-lisp/inline.el @@ -185,7 +185,7 @@ inline--do-quote (push (inline--do-quote (pop exp)) args)) (setq args (nreverse args)) (if exp - `(backquote-list* ,@args ,(inline--do-quote exp)) + `(cons* ,@args ,(inline--do-quote exp)) `(list ,@args)))) (_ (macroexp-quote exp)))) diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el index 9af75320ec..fd5a2864ce 100644 --- a/lisp/emacs-lisp/macroexp.el +++ b/lisp/emacs-lisp/macroexp.el @@ -201,85 +201,84 @@ macroexp--expand-all "Expand all macros in FORM. This is an internal version of `macroexpand-all'. Assumes the caller has bound `macroexpand-all-environment'." - (if (eq (car-safe form) 'backquote-list*) - ;; Special-case `backquote-list*', as it is normally a macro that - ;; generates exceedingly deep expansions from relatively shallow input - ;; forms. We just process it `in reverse' -- first we expand all the - ;; arguments, _then_ we expand the top-level definition. - (macroexpand (macroexp--all-forms form 1) - macroexpand-all-environment) - ;; Normal form; get its expansion, and then expand arguments. - (setq form (macroexp-macroexpand form macroexpand-all-environment)) - (pcase form - (`(cond . ,clauses) - (macroexp--cons 'cond (macroexp--all-clauses clauses) form)) - (`(condition-case . ,(or `(,err ,body . ,handlers) dontcare)) - (macroexp--cons - 'condition-case - (macroexp--cons err - (macroexp--cons (macroexp--expand-all body) - (macroexp--all-clauses handlers 1) - (cddr form)) - (cdr form)) - form)) - (`(,(or 'defvar 'defconst) . ,_) (macroexp--all-forms form 2)) - (`(function ,(and f `(lambda . ,_))) - (macroexp--cons 'function - (macroexp--cons (macroexp--all-forms f 2) - nil - (cdr form)) - form)) - (`(,(or 'function 'quote) . ,_) form) - (`(,(and fun (or 'let 'let*)) . ,(or `(,bindings . ,body) dontcare)) - (macroexp--cons fun - (macroexp--cons (macroexp--all-clauses bindings 1) - (macroexp--all-forms body) - (cdr form)) - form)) - (`(,(and fun `(lambda . ,_)) . ,args) - ;; Embedded lambda in function position. - (macroexp--cons (macroexp--all-forms fun 2) - (macroexp--all-forms args) - form)) - ;; The following few cases are for normal function calls that - ;; are known to funcall one of their arguments. The byte - ;; compiler has traditionally handled these functions specially - ;; by treating a lambda expression quoted by `quote' as if it - ;; were quoted by `function'. We make the same transformation - ;; here, so that any code that cares about the difference will - ;; see the same transformation. - ;; First arg is a function: - (`(,(and fun (or 'funcall 'apply 'mapcar 'mapatoms 'mapconcat 'mapc)) - ',(and f `(lambda . ,_)) . ,args) - (macroexp--warn-and-return - (format "%s quoted with ' rather than with #'" - (list 'lambda (nth 1 f) '...)) - (macroexp--expand-all `(,fun ,f . ,args)))) - ;; Second arg is a function: - (`(,(and fun (or 'sort)) ,arg1 ',(and f `(lambda . ,_)) . ,args) - (macroexp--warn-and-return - (format "%s quoted with ' rather than with #'" - (list 'lambda (nth 1 f) '...)) - (macroexp--expand-all `(,fun ,arg1 ,f . ,args)))) - (`(funcall #',(and f (pred symbolp)) . ,args) - ;; Rewrite (funcall #'foo bar) to (foo bar), in case `foo' - ;; has a compiler-macro. - (macroexp--expand-all `(,f . ,args))) - (`(,func . ,_) - ;; Macro expand compiler macros. This cannot be delayed to - ;; byte-optimize-form because the output of the compiler-macro can - ;; use macros. - (let ((handler (function-get func 'compiler-macro))) - (if (null handler) - ;; No compiler macro. We just expand each argument (for - ;; setq/setq-default this works alright because the variable names - ;; are symbols). - (macroexp--all-forms form 1) - ;; If the handler is not loaded yet, try (auto)loading the - ;; function itself, which may in turn load the handler. - (unless (functionp handler) - (with-demoted-errors "macroexp--expand-all: %S" - (autoload-do-load (indirect-function func) func))) + ;; Normal form; get its expansion, and then expand arguments. + (setq form (macroexp-macroexpand form macroexpand-all-environment)) + (pcase form + (`(cond . ,clauses) + (macroexp--cons 'cond (macroexp--all-clauses clauses) form)) + (`(condition-case . ,(or `(,err ,body . ,handlers) dontcare)) + (macroexp--cons + 'condition-case + (macroexp--cons err + (macroexp--cons (macroexp--expand-all body) + (macroexp--all-clauses handlers 1) + (cddr form)) + (cdr form)) + form)) + (`(,(or 'defvar 'defconst) . ,_) (macroexp--all-forms form 2)) + (`(function ,(and f `(lambda . ,_))) + (macroexp--cons 'function + (macroexp--cons (macroexp--all-forms f 2) + nil + (cdr form)) + form)) + (`(,(or 'function 'quote) . ,_) form) + (`(,(and fun (or 'let 'let*)) . ,(or `(,bindings . ,body) dontcare)) + (macroexp--cons fun + (macroexp--cons (macroexp--all-clauses bindings 1) + (macroexp--all-forms body) + (cdr form)) + form)) + (`(,(and fun `(lambda . ,_)) . ,args) + ;; Embedded lambda in function position. + (macroexp--cons (macroexp--all-forms fun 2) + (macroexp--all-forms args) + form)) + ;; The following few cases are for normal function calls that + ;; are known to funcall one of their arguments. The byte + ;; compiler has traditionally handled these functions specially + ;; by treating a lambda expression quoted by `quote' as if it + ;; were quoted by `function'. We make the same transformation + ;; here, so that any code that cares about the difference will + ;; see the same transformation. + ;; First arg is a function: + (`(,(and fun (or 'funcall 'apply 'mapcar 'mapatoms 'mapconcat 'mapc)) + ',(and f `(lambda . ,_)) . ,args) + (macroexp--warn-and-return + (format "%s quoted with ' rather than with #'" + (list 'lambda (nth 1 f) '...)) + (macroexp--expand-all `(,fun ,f . ,args)))) + ;; Second arg is a function: + (`(,(and fun (or 'sort)) ,arg1 ',(and f `(lambda . ,_)) . ,args) + (macroexp--warn-and-return + (format "%s quoted with ' rather than with #'" + (list 'lambda (nth 1 f) '...)) + (macroexp--expand-all `(,fun ,arg1 ,f . ,args)))) + (`(funcall #',(and f (pred symbolp)) . ,args) + ;; Rewrite (funcall #'foo bar) to (foo bar), in case `foo' + ;; has a compiler-macro. + (macroexp--expand-all `(,f . ,args))) + (`(,func . ,_) + ;; Macro expand compiler macros. This cannot be delayed to + ;; byte-optimize-form because the output of the compiler-macro can + ;; use macros. + (let ((handler (function-get func 'compiler-macro))) + (if (null handler) + ;; No compiler macro. We just expand each argument (for + ;; setq/setq-default this works alright because the variable names + ;; are symbols). + (macroexp--all-forms form 1) + ;; If the handler is not loaded yet, try (auto)loading the + ;; function itself, which may in turn load the handler. + (unless (functionp handler) + (with-demoted-errors "macroexp--expand-all: %S" + (autoload-do-load (indirect-function func) func))) + (if (eq handler 'internal--compiler-macro-cons*) + ;; The `cons*' compiler-macro generates very deep + ;; expansions, so macroexpand the arguments first to + ;; reduce the chance of exceeding recusion depth while + ;; macroexpanding. + (macroexp--compiler-macro handler (macroexp--all-forms form 1)) (let ((newform (macroexp--compiler-macro handler form))) (if (eq form newform) ;; The compiler macro did not find anything to do. @@ -291,9 +290,9 @@ macroexp--expand-all (if (eq newform form) newform (macroexp--expand-all newform))) - (macroexp--expand-all newform)))))) + (macroexp--expand-all newform))))))) - (_ form)))) + (_ form))) ;;;###autoload (defun macroexpand-all (form &optional environment) diff --git a/lisp/subr.el b/lisp/subr.el index c59f13b24c..c0b3c68229 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -577,6 +577,15 @@ cddddr (declare (compiler-macro internal--compiler-macro-cXXr)) (cdr (cdr (cdr (cdr x))))) +(defun internal--compiler-macro-cons* (_form arg &rest others) + (let* ((args (reverse (cons arg others))) + (form (car args))) + (while (setq args (cdr args)) + (setq form `(cons ,(car args) ,form))) + form)) + +(function-put 'cons* 'compiler-macro #'internal--compiler-macro-cons*) + (defun last (list &optional n) "Return the last link of LIST. Its car is the last element. If LIST is nil, return nil. diff --git a/src/alloc.c b/src/alloc.c index 64aaa8acdf..1fb7b1fc0b 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -2699,6 +2699,18 @@ DEFUN ("list", Flist, Slist, 0, MANY, 0, return val; } +DEFUN ("cons*", FconsX, SconsX, 1, MANY, 0, + doc: /* Like `list' but the last argument is the tail of the new list. +(cons* A B C) is equivalent to (cons A (cons B C)). +usage: (cons* FIRST &rest LIST) */) + (ptrdiff_t nargs, Lisp_Object *args) +{ + Lisp_Object val = args[--nargs]; + + while (nargs > 0) + val = Fcons (args[--nargs], val); + return val; +} DEFUN ("make-list", Fmake_list, Smake_list, 2, 2, 0, doc: /* Return a newly created list of length LENGTH, with each element being INIT. */) @@ -7374,6 +7386,7 @@ syms_of_alloc (void) N should be nonnegative. */); defsubr (&Scons); + defsubr (&SconsX); defsubr (&Slist); defsubr (&Svector); defsubr (&Srecord); -- 2.11.0 --=-=-=-- From unknown Mon Aug 18 14:21:48 2025 X-Loop: help-debbugs@gnu.org Subject: bug#16963: A patch to create a list-with-tail primitive. Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 28 Jun 2019 03:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16963 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Noam Postavsky , Lars Ingebrigtsen Cc: 16963@debbugs.gnu.org, Demetrios Obenour Received: via spool by 16963-submit@debbugs.gnu.org id=B16963.156169264526381 (code B ref 16963); Fri, 28 Jun 2019 03:31:02 +0000 Received: (at 16963) by debbugs.gnu.org; 28 Jun 2019 03:30:45 +0000 Received: from localhost ([127.0.0.1]:40173 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hghb3-0006rP-6r for submit@debbugs.gnu.org; Thu, 27 Jun 2019 23:30:45 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:58462) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hghay-0006r7-I7 for 16963@debbugs.gnu.org; Thu, 27 Jun 2019 23:30:43 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x5S3U2sS008324; Fri, 28 Jun 2019 03:30:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=6dECrnEp3MElMZUCIYCglp8VYo3YavqkrpM7Cvm2Cxk=; b=j2AgX95JgBV1DkJPGi5YuEqapqGxrg/ugxFvtK0Uid+uquZJ0eGSzNyQ/+9w879Wmv1I m2rNnhpoppSJEhzUpqLU2Jux1cpRxnNmJCSTriu2F9h0ZBkc0TceB7fN4nVce4BzTBsI GcB/fTvyXu+tlLeFFPxWEAQ6XRcEgyFJ8RekmUiOGehIGBTFZl5CzffpO9TFhl3g/Nmi b4h5xXqdiyyKr+h07rVTiOxn7ufwOylP7Aou0sCCNHJKyVyHf7rC6IKs46YzMmBrqnw5 4vZIbMGLImN+0KrezlfUUR39jxZ3eGSI9ZdE0SyKsggdtAMLY0xd886vpgoHXG/OSKLK xg== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 2t9cyqu8wp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 28 Jun 2019 03:30:33 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x5S3TaWd139434; Fri, 28 Jun 2019 03:30:32 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserp3030.oracle.com with ESMTP id 2t9acdk81w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 28 Jun 2019 03:30:32 +0000 Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x5S3USJn029453; Fri, 28 Jun 2019 03:30:28 GMT MIME-Version: 1.0 Message-ID: <7c902ff5-10cb-467c-b5ed-bf9d4df8cf71@default> Date: Thu, 27 Jun 2019 20:30:27 -0700 (PDT) From: Drew Adams References: <1394200708.1710.4.camel@localhost.localdomain> <877fhuom68.fsf@gnus.org> <87v9wq5rl4.fsf@gmail.com> In-Reply-To: <87v9wq5rl4.fsf@gmail.com> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4861.0 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9301 signatures=668688 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=664 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906280033 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9301 signatures=668688 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=730 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906280033 X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Oh, this reminds me I had started writing a patch for this. I used the > name cons* instead of list* though, I always found it more logical: > cons* is cons repeated, just like let* is let repeated. Let me dust it > off: The name has long been `list*' in Lisp, including in Common Lisp. That's the name that should (still) be used, IMO. http://clhs.lisp.se/Body/f_list_.htm list* is like list except that the last argument to list becomes the car of the last cons constructed, while the last argument to list* becomes the cdr of the last cons constructed. Hence, any given call to list* always produces one fewer conses than a call to list with the same number of arguments. If the last argument to list* is a list, the effect is to construct a new list which is similar, but which has additional elements added to the front corresponding to the preceding arguments of list*. If list* receives only one object, that object is returned, regardless of whether or not it is a list.