From: Glenn Morris <rgm@gnu.org>
To: Wilfred Hughes <wilfred@editd.com>
Cc: 15059@debbugs.gnu.org
Subject: bug#15059: 24.3; nth with negative index values
Date: Fri, 09 Aug 2013 14:52:29 -0400 [thread overview]
Message-ID: <33vc3er91u.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <CAD0QT4LGFPx5rvNyAX3vO6za_cX79hnU5u+eP6h+Bsb8u+8wRQ@mail.gmail.com> (Wilfred Hughes's message of "Fri, 9 Aug 2013 12:55:53 +0100")
Wilfred Hughes wrote:
> (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).
Easy to raise an error (unless something was relying on the behaviour
for -ve arguments?):
*** src/fns.c 2013-08-01 22:24:02 +0000
--- src/fns.c 2013-08-09 18:43:02 +0000
***************
*** 1277,1283 ****
(Lisp_Object n, Lisp_Object list)
{
EMACS_INT i, num;
! CHECK_NUMBER (n);
num = XINT (n);
for (i = 0; i < num && !NILP (list); i++)
{
--- 1277,1283 ----
(Lisp_Object n, Lisp_Object list)
{
EMACS_INT i, num;
! CHECK_NATNUM (n);
num = XINT (n);
for (i = 0; i < num && !NILP (list); i++)
{
next prev parent reply other threads:[~2013-08-09 18:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-09 11:55 bug#15059: 24.3; nth with negative index values Wilfred Hughes
2013-08-09 15:51 ` Andreas Schwab
2013-08-09 18:52 ` Glenn Morris [this message]
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=33vc3er91u.fsf@fencepost.gnu.org \
--to=rgm@gnu.org \
--cc=15059@debbugs.gnu.org \
--cc=wilfred@editd.com \
/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.