emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Request] seq-map and mapcar with arbitrary number of sequences


From: David Kastrup
Subject: Re: [Request] seq-map and mapcar with arbitrary number of sequences
Date: Tue, 13 Oct 2015 14:42:52 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

"John Wiegley" <address@hidden> writes:

>>>>>>   <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]