From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: [Request] seq-map and mapcar with arbitrary number of sequences Date: Tue, 13 Oct 2015 14:42:52 +0200 Message-ID: <87lhb77xdf.fsf@fencepost.gnu.org> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1444753159 13367 80.91.229.3 (13 Oct 2015 16:19:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 13 Oct 2015 16:19:19 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 13 18:19:19 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Zm2IH-00033T-Dm for ged-emacs-devel@m.gmane.org; Tue, 13 Oct 2015 18:19:17 +0200 Original-Received: from localhost ([::1]:34940 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlzXw-0005VF-AN for ged-emacs-devel@m.gmane.org; Tue, 13 Oct 2015 09:23:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59350) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlzUu-0003F3-Kj for emacs-devel@gnu.org; Tue, 13 Oct 2015 09:20:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZlzUo-00040n-A1 for emacs-devel@gnu.org; Tue, 13 Oct 2015 09:20:08 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:34105) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlzUo-00040a-7D for emacs-devel@gnu.org; Tue, 13 Oct 2015 09:20:02 -0400 Original-Received: from localhost ([127.0.0.1]:47922 helo=lola) by fencepost.gnu.org with esmtp (Exim 4.82) (envelope-from ) id 1ZlzUn-0005x8-FJ for emacs-devel@gnu.org; Tue, 13 Oct 2015 09:20:01 -0400 Original-Received: by lola (Postfix, from userid 1000) id A4C83DF4F8; Tue, 13 Oct 2015 14:42:52 +0200 (CEST) In-Reply-To: (John Wiegley's message of "Sat, 10 Oct 2015 10:47:19 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:191492 Archived-At: "John Wiegley" writes: >>>>>> writes: > >> Furthermore, if anyone feels up to the task, I think it would make sense for >> the builtin mapc and mapcar too. > > Those two functions are used in a large number of places. Adding support for a > "&rest seqs" argument rather than "seq" could impact performance, as it now > has to walk a one-element seqs to get the seq it had directly before. I > believe it would add another cons cell to the memory footprint, to package the > argument? I don't think so. The additional &rest argument would usually be nil which isn't a cons cell. The argument list is almost never a Lisp list when open-coded but rather a number of slots in the CPU stack frame (and I think it's not even needed in the byte code stack since it would be the job of the function call code to supply the empty &rest argument to C). As such, an additional cons would be quite the exception rather than the rule. I don't think that the additional CPU stack slot would warrant worrying about performance. -- David Kastrup