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: Michael Heerdegen
Subject: Re: Arbitrary function: find the number(s) of expected arguments
Date: Sat, 19 Mar 2016 19:35:47 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.92 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

> You could convince me by posting a formal proof that such an
> implementation is impossible.

I can't prove the impossibility to implement semantics that are not
(yet) defined.

You haven't defined any semantics, you only said the interpreter would
know the answer.  But I don't know the question.

That's why I ask what for

(advice-add 'f :around
            (defun my-f-around-ad (orig-f &rest args)
              (let ((some-value (g args)))
                (if (function-p (car-safe some-value))
                    (apply (car some-value) (cdr some-value))
                  (if (h args)
                      (k args)
                    (apply orig-f some-value))))))

(function-arity 'f) should return.  Because I hardly see how any return
value would make sense, or more sense than some others.

Surely could you say it should return 17.  I cannot prove that it's not
possible to implement `function-arity' in a way so that it returns 17 in
this case, but my question would be how useful that return value would
be.


Michael.



reply via email to

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