From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Arbitrary function: find the number(s) of expected arguments Date: Sat, 19 Mar 2016 20:14:12 +0200 Message-ID: <83vb4i72tn.fsf@gnu.org> References: <56E8906C.5050405@lanl.gov> <83egb68vfy.fsf@gnu.org> <87zituefp9.fsf@web.de> <83a8lu8srs.fsf@gnu.org> <87twk2ebp2.fsf@web.de> <838u1e8od1.fsf@gnu.org> <87pouqe9yw.fsf@web.de> <837fgy8mho.fsf@gnu.org> <87d1qqe53m.fsf@web.de> <83zitu73wo.fsf@gnu.org> <8760wie4ct.fsf@web.de> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1458411294 22394 80.91.229.3 (19 Mar 2016 18:14:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 19 Mar 2016 18:14:54 +0000 (UTC) Cc: emacs-devel@gnu.org To: Michael Heerdegen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 19 19:14:49 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ahLOj-0005Q2-13 for ged-emacs-devel@m.gmane.org; Sat, 19 Mar 2016 19:14:49 +0100 Original-Received: from localhost ([::1]:49960 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ahLOi-0006yN-9S for ged-emacs-devel@m.gmane.org; Sat, 19 Mar 2016 14:14:48 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51601) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ahLOf-0006yH-PT for emacs-devel@gnu.org; Sat, 19 Mar 2016 14:14:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ahLOa-0002bX-Qu for emacs-devel@gnu.org; Sat, 19 Mar 2016 14:14:45 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:33219) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ahLOa-0002bT-Ng; Sat, 19 Mar 2016 14:14:40 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4405 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1ahLOZ-00073G-UJ; Sat, 19 Mar 2016 14:14:40 -0400 In-reply-to: <8760wie4ct.fsf@web.de> (message from Michael Heerdegen on Sat, 19 Mar 2016 18:59:14 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:201893 Archived-At: > From: Michael Heerdegen > Cc: emacs-devel@gnu.org > Date: Sat, 19 Mar 2016 18:59:14 +0100 > > Eli Zaretskii writes: > > > > > I disagree with this conclusion. The fact is that the Emacs Lisp > > > > interpreter does know how to produce a clear answer. > > > > > > Imagine `f' accepts, say, three arguments. Now, let's > > > > > > (advice-add 'f :around > > > (defun my-f-around-advice (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)))))) > > > > > > What should (function-arity #'f) return? > > > > How is that relevant to the cited text? > > I had concluded that it is not possible to implement `function-arity' so > that it will always give a meaningful return value. You disagreed > (that's the cited text), so I tried to give an example proving my > conclusion. What did I miss? The second sentence in the cited text.