[Top][All Lists]

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

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

From: Paul Pogonyshev
Subject: Re: Arbitrary function: find the number(s) of expected arguments
Date: Mon, 21 Mar 2016 19:36:45 +0100

Eli Zaretskii wrote:
> How about adding a few tests for this in test/ ?

Done in the attached second patch version.

> > +Lisp_Object
> > +get_byte_code_arity (Lisp_Object args_template)
> > +{
> > +  if (INTEGERP (args_template))
> It could also be a list (that was the old style). [...]

Apparently no.  I just based get_byte_code_arity() on what
exec_byte_code() does.

> We have sub-arity, so I think we should remove it and leave an alias
> that will call this new function for backward compatibility.  Having
> both sounds redundant.

Drew Adams wrote:
> This sounds wrong to me.  Just calling the new code (which I
> have not looked at, but which I presume does for arbitrary
> functions what `subr-arity' does for primitives) would NOT
> provide backward compatibility, precisely because it would
> (presumably) NOT have the same behavior as `subr-arity' for
> non-primitives - it would not raise an error.

The patch itself doesn't touch `subr-arity'. Whether to alias
it to `func-arity' or not can be decided later.


Attachment: func-arity.diff
Description: Text document

reply via email to

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