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: Philipp Stephani
Subject: Re: Arbitrary function: find the number(s) of expected arguments
Date: Sat, 19 Mar 2016 16:30:30 +0000



Eli Zaretskii <address@hidden> schrieb am Sa., 19. März 2016 um 17:28 Uhr:
> From: Philipp Stephani <address@hidden>
> Date: Sat, 19 Mar 2016 16:14:04 +0000
> Cc: address@hidden
>
> Knowing the arity in cases like this requires either evaluating the function, or complex parsing of its definition.

What do you mean by "complex parsing"?  Did you look at how the Lisp
interpreter does that?

Yes, but parsing the arglist. But the arglist of g is (&rest args).
 

> 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.

No, that's not g's arity:

  (g 10 202 30) => error -> "Wrong number of arguments"

This cannot be detected without evaluating the function. 

reply via email to

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