From: Wilfred Hughes <wilfred@editd.com>
To: 15059@debbugs.gnu.org
Subject: bug#15059: 24.3; nth with negative index values
Date: Fri, 9 Aug 2013 12:55:53 +0100 [thread overview]
Message-ID: <CAD0QT4LGFPx5rvNyAX3vO6za_cX79hnU5u+eP6h+Bsb8u+8wRQ@mail.gmail.com> (raw)
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 (though
raising an error might be a sensible behaviour instead).
In GNU Emacs 24.3.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.8.2)
of 2013-07-30 on -var-lib-archbuild-staging-x86_64-jgc
Windowing system distributor `The X.Org Foundation', version 11.0.11402000
Configured using:
`configure '--prefix=/usr' '--sysconfdir=/etc' '--libexecdir=/usr/lib'
'--localstatedir=/var' '--with-x-toolkit=gtk3' '--with-xft'
'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector
--param=ssp-buffer-size=4'
'LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro'
'CPPFLAGS=-D_FORTIFY_SOURCE=2''
Important settings:
value of $LANG: en_GB.utf8
value of $XMODIFIERS: @im=ibus
locale-coding-system: utf-8-unix
default enable-multibyte-characters: t
next reply other threads:[~2013-08-09 11:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-09 11:55 Wilfred Hughes [this message]
2013-08-09 15:51 ` bug#15059: 24.3; nth with negative index values Andreas Schwab
2013-08-09 18:52 ` Glenn Morris
2013-08-09 21:58 ` Stefan Monnier
2013-08-10 1:31 ` Glenn Morris
2013-08-12 10:10 ` Wilfred Hughes
2013-08-12 14:09 ` Stefan Monnier
2013-08-13 7:15 ` Glenn Morris
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAD0QT4LGFPx5rvNyAX3vO6za_cX79hnU5u+eP6h+Bsb8u+8wRQ@mail.gmail.com \
--to=wilfred@editd.com \
--cc=15059@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.