GNU bug report logs - #31872
27.0.50; nil is nil but maybe inside a list

Previous Next

Package: emacs;

Reported by: Tomas Nordin <tomasn <at> posteo.net>

Date: Sun, 17 Jun 2018 10:53:01 UTC

Severity: wishlist

Found in version 27.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 31872 in the body.
You can then email your comments to 31872 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#31872; Package emacs. (Sun, 17 Jun 2018 10:53:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tomas Nordin <tomasn <at> posteo.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 17 Jun 2018 10:53:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tomas Nordin <tomasn <at> posteo.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0.50; nil is nil but maybe inside a list
Date: Sun, 17 Jun 2018 12:51:37 +0200
Hello List

I was confused some day ago about the effect of providing an explicit
nil for a &rest argument in a call to a comint function. Reading the
documentation on argument lists I thought there might be some room for
improvement (or to make it easier to read).

Hoping I have not misunderstood the workings of &rest all along, what do
you think about this diff:

1 file changed, 8 insertions(+), 4 deletions(-)
doc/lispref/functions.texi | 12 ++++++++----

modified   doc/lispref/functions.texi
@@ -412,10 +412,14 @@ Argument List
 binds @code{a} and @code{b} to the first two actual arguments, which are
 required.  If one or two more arguments are provided, @code{c} and
 @code{d} are bound to them respectively; any arguments after the first
-four are collected into a list and @code{e} is bound to that list.  If
-there are only two arguments, @code{c} is @code{nil}; if two or three
-arguments, @code{d} is @code{nil}; if four arguments or fewer, @code{e}
-is @code{nil}.
+four are collected into a list and @code{e} is bound to that list.  So,
+if there are only two arguments, @code{c}, @code{d} and @code{e} are
+@code{nil}; if two or three arguments, @code{d} and @code{e} are
+@code{nil}; if four arguments or fewer, @code{e} is @code{nil}.  Observe
+that with five arguments with an explicit @code{nil} argument provided
+for @code{e}, that @code{nil} argument is collected into a list with one
+element (which is @code{nil}), as with any other single value for
+@code{e}---the @code{&rest} argument.
 
   There is no way to have required arguments following optional
 ones---it would not make sense.  To see why this must be so, suppose



In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.11)
 of 2017-12-17 built on fliptop
Repository revision: b4486de0c6484a09dcd6485c19062419279ca296
Windowing system distributor 'The X.Org Foundation', version 11.0.11902000
System Description: Debian GNU/Linux 9.4 (stretch)

Best regards
--
Tomas




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sat, 23 Jun 2018 07:41:01 GMT) Full text and rfc822 format available.

Notification sent to Tomas Nordin <tomasn <at> posteo.net>:
bug acknowledged by developer. (Sat, 23 Jun 2018 07:41:01 GMT) Full text and rfc822 format available.

Message #10 received at 31872-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Tomas Nordin <tomasn <at> posteo.net>
Cc: 31872-done <at> debbugs.gnu.org
Subject: Re: bug#31872: 27.0.50; nil is nil but maybe inside a list
Date: Sat, 23 Jun 2018 10:40:27 +0300
> From: Tomas Nordin <tomasn <at> posteo.net>
> Date: Sun, 17 Jun 2018 12:51:37 +0200
> 
> I was confused some day ago about the effect of providing an explicit
> nil for a &rest argument in a call to a comint function. Reading the
> documentation on argument lists I thought there might be some room for
> improvement (or to make it easier to read).
> 
> Hoping I have not misunderstood the workings of &rest all along, what do
> you think about this diff:

Thanks, I made a similar change in the manual to clarify the
explanation.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 21 Jul 2018 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 27 days ago.

Previous Next


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