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: Davis Herring
Subject: Re: Arbitrary function: find the number(s) of expected arguments
Date: Mon, 18 Apr 2016 12:43:54 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0

[I'm back from vacation; a few already-old threads caught my eye.]

Any existing code that depends on an error being raised by
`subr-arity' would break.  E.g.,

(condition-case err
     (subr-arity 'foo)
   (error (do-something)))

This issue is that of undefined behavior: is (subr-arity 0) UB or is it defined to be an error? The doc string says simply "SUBR must be a built-in function." which is language typical of UB in some contexts, but Emacs doesn't explicitly have that notion to my knowledge.

If it's UB, then your example is wrong already and its breakage is irrelevant. If the error is a defined part of the interface, then yes the change is incompatible. All kinds of interfaces are thoroughly defined only for a subset of cases, and it's as much as anything a cultural issue whether the (historical) implementation's behavior outside that set is sacrosanct or not.

Davis

--
This product is sold by volume, not by mass. If it appears too dense or too sparse, it is because mass-energy conversion has occurred during shipping.



reply via email to

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