[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: |
Tue, 24 Dec 2024 10:18:20 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
> 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?
> Would it be significantly more efficient than doing it "by hand" e.g.:
>
> (let ((l (length X)))
> (nth (if (< i 0) (- l i) i) X))
AFAICT so far people were only able to fix my code but not answer my
question, which suggests the answer is no, which would be a good
argument in favor of staying with the current behavior: the change
wouldn't save us from going down the list twice.
Stefan
- Negative nth index, Anand Tamariya, 2024/12/22
- Re: Negative nth index, Eli Zaretskii, 2024/12/22
- Re: Negative nth index, Tassilo Horn, 2024/12/22
- Re: Negative nth index, Teemu Likonen, 2024/12/24
- Re: Negative nth index,
Stefan Monnier <=
- Re: Negative nth index, Sebastián Monía, 2024/12/24
- Re: Negative nth index, Pip Cet, 2024/12/24
- Re: Negative nth index, Mattias Engdegård, 2024/12/25
- Re: Negative nth index, Pip Cet, 2024/12/25
- Re: Negative nth index, Mattias Engdegård, 2024/12/25
- Re: Negative nth index, Pip Cet, 2024/12/25
- Re: Negative nth index, Stefan Kangas, 2024/12/25
- Re: Negative nth index, Stefan Monnier, 2024/12/25
- Re: Negative nth index, Stefan Kangas, 2024/12/25
Re: Negative nth index, Andreas Schwab, 2024/12/22