[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.
- Re: Arbitrary function: find the number(s) of expected arguments, (continued)
- Re: Arbitrary function: find the number(s) of expected arguments, Elias Mårtenson, 2016/03/26
- Re: Arbitrary function: find the number(s) of expected arguments, Stefan Monnier, 2016/03/26
- Re: Arbitrary function: find the number(s) of expected arguments, Philipp Stephani, 2016/03/19
- Re: Arbitrary function: find the number(s) of expected arguments, Paul Pogonyshev, 2016/03/19
- Re: Arbitrary function: find the number(s) of expected arguments, Eli Zaretskii, 2016/03/19
- RE: Arbitrary function: find the number(s) of expected arguments, Drew Adams, 2016/03/19
- Re: Arbitrary function: find the number(s) of expected arguments,
Michael Heerdegen <=
- Re: Arbitrary function: find the number(s) of expected arguments, Eli Zaretskii, 2016/03/19
- Re: Arbitrary function: find the number(s) of expected arguments, Michael Heerdegen, 2016/03/19
- Re: Arbitrary function: find the number(s) of expected arguments, Paul Pogonyshev, 2016/03/21
- Re: Arbitrary function: find the number(s) of expected arguments, Eli Zaretskii, 2016/03/25
- Re: Arbitrary function: find the number(s) of expected arguments, Paul Pogonyshev, 2016/03/25
- RE: Arbitrary function: find the number(s) of expected arguments, Drew Adams, 2016/03/25
- Re: Arbitrary function: find the number(s) of expected arguments, Paul Pogonyshev, 2016/03/25
- RE: Arbitrary function: find the number(s) of expected arguments, Drew Adams, 2016/03/25
- Re: Arbitrary function: find the number(s) of expected arguments, Clément Pit--Claudel, 2016/03/25
- Use plain-text for mail [was: Arbitrary function: find the number(s) of expected arguments], Drew Adams, 2016/03/25