[Top][All Lists]

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

bug#16963: A patch to create a list-with-tail primitive.

From: Daniel Colascione
Subject: bug#16963: A patch to create a list-with-tail primitive.
Date: Fri, 28 Mar 2014 18:48:09 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

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. :-)

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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