emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Docs for &optional and &rest arguments together


From: arthur miller
Subject: RE: Docs for &optional and &rest arguments together
Date: Thu, 31 Dec 2020 07:55:26 +0000

I don't read it says both c and d are required when &rest is also used. 


-------- Originalmeddelande --------
Från: Lars Ingebrigtsen <larsi@gnus.org>
Datum: 2020-12-31 05:44 (GMT+01:00)
Till: Arthur Miller <arthur.miller@live.com>
Kopia: emacs-devel@gnu.org
Ämne: Re: Docs for &optional and &rest arguments together

Arthur Miller <arthur.miller@live.com> writes:

>> The paragraph just below this one, though, describes in detail what
>> happens with a mixed &optional and &rest argument list, so that's not my
>> impression when reading that node.
>
> "A call to the function requires one actual argument for each of the

No, this bit:

For example, an argument list that looks like this:

(a b &optional c d &rest e)

binds a and b to the first two actual arguments, which are required. If
one or two more arguments are provided, c and d are bound to them
respectively; any arguments after the first four are collected into a
list and e is bound to that list.  Thus, if there are only two
arguments, c, d and e are nil; if two or three arguments, d and e are
nil; if four arguments or fewer, e is nil. Note that exactly five
arguments with an explicit nil argument provided for e will cause that
nil argument to be passed as a list with one element, (nil), as with any
other single value for e.


--
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no

reply via email to

[Prev in Thread] Current Thread [Next in Thread]