* bug#31872: 27.0.50; nil is nil but maybe inside a list
@ 2018-06-17 10:51 Tomas Nordin
2018-06-23 7:40 ` Eli Zaretskii
0 siblings, 1 reply; 2+ messages in thread
From: Tomas Nordin @ 2018-06-17 10:51 UTC (permalink / raw)
To: 31872
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* bug#31872: 27.0.50; nil is nil but maybe inside a list
2018-06-17 10:51 bug#31872: 27.0.50; nil is nil but maybe inside a list Tomas Nordin
@ 2018-06-23 7:40 ` Eli Zaretskii
0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2018-06-23 7:40 UTC (permalink / raw)
To: Tomas Nordin; +Cc: 31872-done
> From: Tomas Nordin <tomasn@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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-06-23 7:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-17 10:51 bug#31872: 27.0.50; nil is nil but maybe inside a list Tomas Nordin
2018-06-23 7:40 ` Eli Zaretskii
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.