[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How many parameters does an elisp function take?
From: |
Stefan Monnier |
Subject: |
Re: How many parameters does an elisp function take? |
Date: |
Tue, 22 Feb 2005 09:41:03 -0500 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
>> 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