From: David Kastrup <dak@gnu.org>
To: emacs-devel@gnu.org
Subject: Re: [Request] seq-map and mapcar with arbitrary number of sequences
Date: Tue, 13 Oct 2015 14:42:52 +0200 [thread overview]
Message-ID: <87lhb77xdf.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <m21td2k448.fsf@newartisans.com> (John Wiegley's message of "Sat, 10 Oct 2015 10:47:19 -0700")
"John Wiegley" <johnw@newartisans.com> writes:
>>>>>> <bruce.connor.am@gmail.com> 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
prev parent reply other threads:[~2015-10-13 12:42 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-10 7:24 [Request] seq-map and mapcar with arbitrary number of sequences bruce.connor.am
2015-10-10 17:47 ` John Wiegley
2015-10-10 17:58 ` David Kastrup
2015-10-10 20:10 ` John Wiegley
2015-10-10 21:53 ` Artur Malabarba
2015-10-10 23:24 ` John Wiegley
2015-10-11 20:36 ` Nicolas Petton
2015-10-11 20:48 ` John Wiegley
2015-10-11 20:51 ` Richard Stallman
2015-10-11 21:10 ` Nicolas Petton
2015-10-12 9:27 ` Michael Heerdegen
2015-10-13 12:42 ` David Kastrup [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87lhb77xdf.fsf@fencepost.gnu.org \
--to=dak@gnu.org \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.