From: Tomas Nordin <tomasn@posteo.net>
To: 31872@debbugs.gnu.org
Subject: bug#31872: 27.0.50; nil is nil but maybe inside a list
Date: Sun, 17 Jun 2018 12:51:37 +0200 [thread overview]
Message-ID: <87lgbd8z46.fsf@fliptop.i-did-not-set--mail-host-address--so-tickle-me> (raw)
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
next reply other threads:[~2018-06-17 10:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-17 10:51 Tomas Nordin [this message]
2018-06-23 7:40 ` bug#31872: 27.0.50; nil is nil but maybe inside a list Eli Zaretskii
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87lgbd8z46.fsf@fliptop.i-did-not-set--mail-host-address--so-tickle-me \
--to=tomasn@posteo.net \
--cc=31872@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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).