Eli Zaretskii <eliz@gnu.org> schrieb am Sa., 19. März 2016 um 16:44 Uhr:
> For example:
>
> > > (defun f (a b) (list a b))
> > >
> > > (defalias 'g (apply-partially #'f 1))
> > >
> > > what would (func-arity 'g) return?
> >
> > Ideally, it should return (1 . 1).
>
> This signature can be interpreted as "accepts any number of arguments",
> whereby it doesn't.  The condition-case solution with the wrong number
> of args handler at least also catches this case.

But Emacs itself clearly _knows_ that only one argument is acceptable.
So a function that replicates the steps made by the Lisp interpreter
to arrive at this conclusion will be able to reach the same
conclusion.  So I don't see any insoluble problems here.

Knowing the arity in cases like this requires either evaluating the function, or complex parsing of its definition. It is very reasonable to assume that (func-arity 'g) would return (0 . many), because that is g's arity as far as the Lisp interpreter is concerned.