emacs-devel
[Top][All Lists]
Advanced

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

Re: Negative nth index


From: Stefan Monnier
Subject: Re: Negative nth index
Date: Wed, 25 Dec 2024 12:22:00 -0500
User-agent: Gnus/5.13 (Gnus v5.13)

>> [ I'd make it return 2 otherwise you can't use it to return the
>>   last element.  ]
> I think the OP meant that (nth -1 '(1 2)) is 1 on current Emacs, which
> is definitely unexpected.

Ah.. you're right that makes a lot more sense.

>> I don't see a strong argument in favor of making it index from the end
>> rather than signal an error.  What would the implementation look like?
> I agree, but the current implementation does not signal an error.  It
> should, and I think that's what the suggestion was.

Sorry for misreading.  I'd prefer that we signal an error, yes.
Not sure it's worth the risk of breaking existing code, OTOH.


        Stefan




reply via email to

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