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

From: Stefan Kangas <[email-masked]>
Date: Mon, 30 Sep 2019 04:39:27 +0200

tags 18555 + notabug wontfix
close 18555
quit

Andreas Schwab <[email-masked]> writes:

> Leo Liu <[email-masked]> 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