From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.devel Subject: Re: Arbitrary function: find the number(s) of expected arguments Date: Sat, 19 Mar 2016 20:32:25 +0100 Message-ID: <87wpoyclh2.fsf@web.de> References: <56E8906C.5050405@lanl.gov> <83y49e731p.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1458415989 25463 80.91.229.3 (19 Mar 2016 19:33:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 19 Mar 2016 19:33:09 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 19 20:32:53 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 1ahMcH-0000Dc-1n for ged-emacs-devel@m.gmane.org; Sat, 19 Mar 2016 20:32:53 +0100 Original-Received: from localhost ([::1]:50165 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ahMcG-0002k6-Bm for ged-emacs-devel@m.gmane.org; Sat, 19 Mar 2016 15:32:52 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36333) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ahMc1-0002jY-Un for emacs-devel@gnu.org; Sat, 19 Mar 2016 15:32:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ahMby-0005gG-Ls for emacs-devel@gnu.org; Sat, 19 Mar 2016 15:32:37 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:56483) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ahMby-0005gA-Fc for emacs-devel@gnu.org; Sat, 19 Mar 2016 15:32:34 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ahMbv-0008Sp-NH for emacs-devel@gnu.org; Sat, 19 Mar 2016 20:32:31 +0100 Original-Received: from dslb-094-218-210-027.094.218.pools.vodafone-ip.de ([94.218.210.27]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 19 Mar 2016 20:32:31 +0100 Original-Received: from michael_heerdegen by dslb-094-218-210-027.094.218.pools.vodafone-ip.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 19 Mar 2016 20:32:31 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 30 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: dslb-094-218-210-027.094.218.pools.vodafone-ip.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.92 (gnu/linux) Cancel-Lock: sha1:pC5EVXdPWitqZqCGBJgVrB6fZpk= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:201897 Archived-At: Eli Zaretskii writes: > Thanks. A few comments below. Let's wait for a few days to give > others a chance to comment. That approach will reveal the (0 . many) problem as we discussed, e.g. (defun f (x y) x) (advice-add 'f :filter-return #'identity) (func-arity 'f) (0 . many) So, to the question "can I call function X with that many args", the answer can be "maybe". In that case, the situation is not better than now. Since you know the answer not before run-time, this doesn't solve the problem in the bug report, because you still have to write alternative code for the "maybe" case - every time. Don't take me wrong: this patch can be useful, e.g. for generating help pages. But IMO it isn't useful for coding. On the contrary, I think advertising `func-arity' to the user with this name will lead to a lot of erroneous code. Michael.