emacs-devel
[Top][All Lists]
Advanced

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

Re: Arbitrary function: find the number(s) of expected arguments


From: Michael Heerdegen
Subject: Re: Arbitrary function: find the number(s) of expected arguments
Date: Sat, 19 Mar 2016 20:32:25 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.92 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

> Thanks.  A few comments below.  Let's wait for a few days to give
> others a chance to comment.

That approach will reveal the (0 . many) problem as we discussed, e.g.


  (defun f (x y) x)

  (advice-add 'f :filter-return #'identity)

  (func-arity 'f)

  (0 . many)


So, to the question "can I call function X with that many args", the
answer can be "maybe".  In that case, the situation is not better than
now.  Since you know the answer not before run-time, this doesn't solve
the problem in the bug report, because you still have to write
alternative code for the "maybe" case - every time.

Don't take me wrong: this patch can be useful, e.g. for generating help
pages.  But IMO it isn't useful for coding.  On the contrary, I think
advertising `func-arity' to the user with this name will lead to a lot
of erroneous code.


Michael.




reply via email to

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