[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Docs for &optional and &rest arguments together
From: |
Lars Ingebrigtsen |
Subject: |
Re: Docs for &optional and &rest arguments together |
Date: |
Thu, 31 Dec 2020 05:43:55 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
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
- Docs for &optional and &rest arguments together, Arthur Miller, 2020/12/29
- Re: Docs for &optional and &rest arguments together, Adam Porter, 2020/12/29
- Re: Docs for &optional and &rest arguments together, Lars Ingebrigtsen, 2020/12/29
- Re: Docs for &optional and &rest arguments together, Arthur Miller, 2020/12/30
- Re: Docs for &optional and &rest arguments together, Yuri Khan, 2020/12/30
- Re: Docs for &optional and &rest arguments together,
Lars Ingebrigtsen <=
- RE: Docs for &optional and &rest arguments together, arthur miller, 2020/12/31
- Re: Docs for &optional and &rest arguments together, tomas, 2020/12/31
- RE: Docs for &optional and &rest arguments together, Drew Adams, 2020/12/31
- RE: Docs for &optional and &rest arguments together, Drew Adams, 2020/12/31
- RE: Docs for &optional and &rest arguments together, arthur miller, 2020/12/31
- RE: Docs for &optional and &rest arguments together, Drew Adams, 2020/12/31
- RE: Docs for &optional and &rest arguments together, arthur miller, 2020/12/31
- RE: Docs for &optional and &rest arguments together, Drew Adams, 2020/12/31
- RE: Docs for &optional and &rest arguments together, arthur miller, 2020/12/31
- Re: Docs for &optional and &rest arguments together, Daniel Brooks, 2020/12/31