bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#18555: 24.4.50; butlast and nbutlast doesn't handle improper lists


From: Stefan Kangas
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@suse.de> writes:

> Leo Liu <sdl.web@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





reply via email to

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