From: Heime <heimeborgia@protonmail.com>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: help-gnu-emacs@gnu.org
Subject: Re: [External] : Handling nil values in optional argument
Date: Fri, 12 Jul 2024 12:48:21 +0000 [thread overview]
Message-ID: <bXsC6rHg02h7dbz3iOWJWTsDbA-u9WFQXyS7oVatqN7ecQmf10c5PdTAPtF3pqK_MY4vcB9V0tPsgM-wYqo4FBSSeG7RZaIjXBctKqFGH5E=@protonmail.com> (raw)
In-Reply-To: <8734ofgr8q.fsf@web.de>
On Friday, July 12th, 2024 at 4:37 PM, Michael Heerdegen via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> wrote:
> Drew Adams drew.adams@oracle.com writes:
>
> > Instead, your code can use something other than nil for the value that
> > you pass as an explicit argument. It can use the singleton list
> > (nil), for example.
>
>
> Alternatively one can give the defun an &rest argument list and look at
> the length of the specified list in the body. The argument variables
> would have to be assigned in the body. Use an advertised calling
> convention to get argument name support back for eldoc etc.
>
> I guess that's more or less what's cl-defun also does. So one can also
> use cl-defun. Or just do as Drew said.
>
>
> Michael.
Can you show an example of using &rest for the specified purpose.
next prev parent reply other threads:[~2024-07-12 12:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-11 22:38 Handling nil values in optional argument Heime
2024-07-12 2:37 ` [External] : " Drew Adams
2024-07-12 4:37 ` Michael Heerdegen via Users list for the GNU Emacs text editor
2024-07-12 12:48 ` Heime [this message]
2024-07-13 4:56 ` Michael Heerdegen via Users list for the GNU Emacs text editor
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='bXsC6rHg02h7dbz3iOWJWTsDbA-u9WFQXyS7oVatqN7ecQmf10c5PdTAPtF3pqK_MY4vcB9V0tPsgM-wYqo4FBSSeG7RZaIjXBctKqFGH5E=@protonmail.com' \
--to=heimeborgia@protonmail.com \
--cc=help-gnu-emacs@gnu.org \
--cc=michael_heerdegen@web.de \
/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 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.