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.

Full log


View this message in rfc822 format

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




This bug report was last modified 5 years and 293 days ago.

Previous Next


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