GNU bug report logs - #18555
24.4.50; butlast and nbutlast doesn't handle improper lists

Previous Next

Package: emacs;

Reported by: Leo Liu <sdl.web <at> gmail.com>

Date: Thu, 25 Sep 2014 04:07:02 UTC

Severity: minor

Tags: notabug, wontfix

Found in version 24.4.50

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 18555 in the body.
You can then email your comments to 18555 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#18555; Package emacs. (Thu, 25 Sep 2014 04:07:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Leo Liu <sdl.web <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 25 Sep 2014 04:07:02 GMT) Full text and rfc822 format available.

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

From: Leo Liu <sdl.web <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.4.50; butlast and nbutlast doesn't handle improper lists
Date: Thu, 25 Sep 2014 12:05:49 +0800
  (nbutlast '(1 2 . 3))

throws an error due to `length' which can be fixed
by using safe-length instead.

  (butlast '(1 2 . 3))

still throws an error due to copy-sequence not taking
improper list.

What is the right thing to do?

Leo




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18555; Package emacs. (Thu, 25 Sep 2014 07:22:02 GMT) Full text and rfc822 format available.

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

From: Andreas Schwab <schwab <at> suse.de>
To: Leo Liu <sdl.web <at> gmail.com>
Cc: 18555 <at> debbugs.gnu.org
Subject: Re: bug#18555: 24.4.50;
 butlast and nbutlast doesn't handle improper lists
Date: Thu, 25 Sep 2014 09:21:50 +0200
Leo Liu <sdl.web <at> gmail.com> writes:

>   (nbutlast '(1 2 . 3))
>
> throws an error due to `length' which can be fixed
> by using safe-length instead.
>
>   (butlast '(1 2 . 3))
>
> still throws an error due to copy-sequence not taking
> improper list.
>
> What is the right thing to do?

Don't do that then.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab <at> suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18555; Package emacs. (Mon, 30 Sep 2019 02:40:01 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Andreas Schwab <schwab <at> suse.de>
Cc: 18555 <at> debbugs.gnu.org, Leo Liu <sdl.web <at> gmail.com>
Subject: Re: bug#18555: 24.4.50;
 butlast and nbutlast doesn't handle improper lists
Date: Mon, 30 Sep 2019 04:39:27 +0200
tags 18555 + notabug wontfix
close 18555
quit

Andreas Schwab <schwab <at> suse.de> writes:

> Leo Liu <sdl.web <at> gmail.com> writes:
>
>>   (nbutlast '(1 2 . 3))
>>
>> throws an error due to `length' which can be fixed
>> by using safe-length instead.
>>
>>   (butlast '(1 2 . 3))
>>
>> still throws an error due to copy-sequence not taking
>> improper list.
>>
>> What is the right thing to do?
>
> Don't do that then.

Agreed.  Both butlast and nbutlast are documented to work on lists, and
throwing a malformed list at them should correctly signal an error.

I'm therefore closing this bug report.

Best regards,
Stefan Kangas




Added tag(s) wontfix and notabug. Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Mon, 30 Sep 2019 02:40:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 18555 <at> debbugs.gnu.org and Leo Liu <sdl.web <at> gmail.com> Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Mon, 30 Sep 2019 02:40:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 28 Oct 2019 11:24:14 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 182 days ago.

Previous Next


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