GNU bug report logs - #21782
25.0.50; New functions nfront/front

Previous Next

Package: emacs;

Reported by: Tino Calancha <f92capac <at> gmail.com>

Date: Thu, 29 Oct 2015 09:55:01 UTC

Severity: wishlist

Found in version 25.0.50

Done: Tino Calancha <tino.calancha <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #41 received at 21782 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Constantino Calancha <f92capac <at> gmail.com>
Cc: "21782 <at> debbugs.gnu.org" <21782 <at> debbugs.gnu.org>
Subject: Re: bug#21782: 25.0.50; New functions nfront/front
Date: Fri, 30 Oct 2015 15:09:10 +0100
"Constantino Calancha" <f92capac <at> gmail.com> writes:

> Im sorry Michael, but i dont see your point: do you mean the fact to
> call nreverse twice?  nreverse is in fact very efficient; and last
> already use nthcdr in its implementation.

`nreverse` efficiently does what is supposed to do, yes.  But it is
O(l), where l is the length of the list arg.

In addition, the newly created `nreverse'd list must be garbage
collected.

The `copy-sequence' call in `front' is bad for the same reason.

OTOH nfront can be implemented in O(n), where n is the number argument
to nfront.


Michael.




This bug report was last modified 8 years and 61 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.