GNU bug report logs - #15059
24.3; nth with negative index values

Previous Next

Package: emacs;

Reported by: Wilfred Hughes <wilfred <at> editd.com>

Date: Fri, 9 Aug 2013 11:57:01 UTC

Severity: minor

Tags: notabug, wontfix

Found in version 24.3

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Wilfred Hughes <wilfred <at> editd.com>
Cc: 15059 <at> debbugs.gnu.org
Subject: bug#15059: 24.3; nth with negative index values
Date: Fri, 09 Aug 2013 17:51:50 +0200
Wilfred Hughes <wilfred <at> editd.com> writes:

> I've noticed that nth returns the first item in a list, when it's given
> a negative index.
>
> (nth -1 '(5 6 7)) ;; 5
> (nth -2 '(5 6 7)) ;; 5
>
> Judging by my reading of the docstring, I was expecting nil

The list is longer than -1, so this case doesn't apply.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




This bug report was last modified 11 years and 286 days ago.

Previous Next


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