From: Stefan Monnier <monnier@iro.umontreal.ca>
Subject: Re: How many parameters does an elisp function take?
Date: Tue, 22 Feb 2005 09:41:03 -0500 [thread overview]
Message-ID: <874qg47jbk.fsf-monnier+gnu.emacs.help@gnu.org> (raw)
In-Reply-To: rg95vc.36.ln@acm.acm
>> In practice, it's simpler to just do
>> (condition-case nil
>> (fooo)
>> (wrong-number-of-arguments
>> (bar)))
>> It's not perfect, but I've found it to suffer from fewer problems than
>> other solutions. It's also faster.
> Good idea!
> Why is there not such a function in the Emacs core?
The example code above shows there *is* such a functionality. If you mean
"why is there no `function-can-accept-N-args' function", then the answer is
probably that most people ask for the inconvenient "function-arity" instead
and get turned down.
> It seems such an incredibly useful function, say for debuggers or
> code-analysers, or for the uses mentioned above. Did somebody just
> overlook it in the early days, perhaps?
Seeing how this kind of thing is basically never used, and how the specific
info needed tends to be subtly different each time, I guess it's not just
an overlook, but a lack of clear evidence of a need.
Stefan
prev parent reply other threads:[~2005-02-22 14:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-16 20:11 How many parameters does an elisp function take? Alan Mackenzie
2005-02-16 20:45 ` Kevin Rodgers
2005-02-16 21:02 ` David Kastrup
2005-02-16 23:56 ` Kevin Rodgers
2005-02-18 13:59 ` Stefan Monnier
2005-02-18 17:43 ` Alan Mackenzie
2005-02-22 14:41 ` Stefan Monnier [this message]
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=874qg47jbk.fsf-monnier+gnu.emacs.help@gnu.org \
--to=monnier@iro.umontreal.ca \
/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.
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).