From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#40968: 28.0.50; (apply nil) Date: Wed, 6 May 2020 12:26:09 -0700 (PDT) Message-ID: <01f325dd-c613-492c-b2c0-affd836e01c6@default> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="94568"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 40968@debbugs.gnu.org To: Pip Cet , Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 06 21:27:12 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jWPhG-000OOk-2H for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 06 May 2020 21:27:10 +0200 Original-Received: from localhost ([::1]:34528 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jWPhF-0003BT-1w for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 06 May 2020 15:27:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45218) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWPh8-0003BI-Df for bug-gnu-emacs@gnu.org; Wed, 06 May 2020 15:27:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57894) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jWPh7-0005Xu-Lw for bug-gnu-emacs@gnu.org; Wed, 06 May 2020 15:27:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jWPh7-0001hq-IM for bug-gnu-emacs@gnu.org; Wed, 06 May 2020 15:27:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 06 May 2020 19:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40968 X-GNU-PR-Package: emacs Original-Received: via spool by 40968-submit@debbugs.gnu.org id=B40968.15887931796511 (code B ref 40968); Wed, 06 May 2020 19:27:01 +0000 Original-Received: (at 40968) by debbugs.gnu.org; 6 May 2020 19:26:19 +0000 Original-Received: from localhost ([127.0.0.1]:41207 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jWPgR-0001gv-2B for submit@debbugs.gnu.org; Wed, 06 May 2020 15:26:19 -0400 Original-Received: from userp2120.oracle.com ([156.151.31.85]:51098) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jWPgP-0001gh-Kw for 40968@debbugs.gnu.org; Wed, 06 May 2020 15:26:18 -0400 Original-Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 046JNqXQ082905; Wed, 6 May 2020 19:26:11 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=FgQkf6VMDndpNeH4DutsMw8jGozXIwEvan2xJyU1Y7M=; b=0cBu42rISqab/RcdfDxRCM/zQrf84i+sCpZfwDanN2A39WWaDqBdm8bO47QmIVvR5ggZ bd8jBCa908K8BNa1BFL+AMnzobQ8Pu2HBtvxt21JSXLdSCtsN36KvD7ENJmUU3hembzk hw5/b2/WBoDyrwsRIRlSwCLBXzGTPbHdgxaCactXWZKyqKreQ7lXVxoOaG9F2jYPAOhz l5WiP5sZSa5hr+ErLMl0ZzNoEK8HJQXYbuWbVXgJfvGtvMS+7R7HVNNshVyeY+VhWtOb GqcG7syjtrUe5BR603Vg5lDEy8z/cIIPjwrB96zQ+KfZ17CLq4FyycPOSZ335QVaoUXs Pg== Original-Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 30s1gnc593-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 06 May 2020 19:26:11 +0000 Original-Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 046JMpvl170617; Wed, 6 May 2020 19:26:11 GMT Original-Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3030.oracle.com with ESMTP id 30sjdw6g2c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 06 May 2020 19:26:11 +0000 Original-Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 046JQAWF027804; Wed, 6 May 2020 19:26:10 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4993.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9613 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 mlxscore=0 bulkscore=0 adultscore=0 phishscore=0 mlxlogscore=999 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2005060156 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9613 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 suspectscore=0 mlxscore=0 spamscore=0 clxscore=1015 priorityscore=1501 bulkscore=0 phishscore=0 impostorscore=0 malwarescore=0 lowpriorityscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2005060156 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:179841 Archived-At: > > > Is the function signature relevant for anything but eldoc? It should be relevant in terms of raising an error if the signature is not respected. > > Besides the docstring, the manual documents it. The suggested form > > is unusual and makes it harder to understand, IMHO. >=20 > I think it's hard to understand Elisp apply from a standard signature, > because it's really >=20 > (apply FUNCTION &rest INDIVIDUAL-ARGUMENTS ARGUMENT-LIST) > or > (apply FUNCTION-AND-ARGUMENT-LIST) >=20 > The latter (which takes a single argument) is not a special case of > the former (which takes 2,3,4,... arguments). (apply FUNCTION) and (apply) should raise an error, IMO (as in Common Lisp). Is there a good use case for either? > > If I understand correctly, you propose a three argument form: > > (apply FUNCTION ARGUMENT &rest ARGUMENTS) >=20 > That's a 2,3,4...-argument form. It's what Common Lisp prescribes. > > This is what I find unusual. It should really be either > > (apply FUNCTION &rest ARGUMENTS) > > or (apply FUNCTION ARGUMENTS) >=20 > That's a 2-argument form. That second form is the same as (apply FUNCTION ARGUMENT). And in that second form it's fine for ARGUMENT to be nil. The first form should raise an error if ARGUMENTS is nil. > > Maybe there's a case to be made for a syntactic alternative to > > "&rest" which disallows nil, which I guess is the issue here? An &rest which must not be nil is written as: ARGUMENT &rest MORE-ARGS &rest is just a list. It can always be nil. > > My point is mainly that it has two arguments: f and args. >=20 > I think we're all in agreement about 2-argument apply. > 3,4,...-argument apply is an unfortunate legacy but one we're stuck > with now. 1-argument apply is the issue here. I'm not in agreement, FWIW. The behavior and its description should be as for Common Lisp: require at least 2 args: FUNCTION and its first ARGUMENT. Is there some use case for (apply f) and (apply)?