From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Pip Cet Newsgroups: gmane.emacs.bugs Subject: bug#40968: 28.0.50; (apply nil) Date: Wed, 6 May 2020 18:06:31 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="6947"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 40968@debbugs.gnu.org To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 06 20:08:32 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 1jWOTA-0001fi-CT for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 06 May 2020 20:08:32 +0200 Original-Received: from localhost ([::1]:53958 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jWOT9-0001pn-BN for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 06 May 2020 14:08:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54960) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWOSg-0001Rk-CO for bug-gnu-emacs@gnu.org; Wed, 06 May 2020 14:08:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57843) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jWOSg-0000Xj-2x for bug-gnu-emacs@gnu.org; Wed, 06 May 2020 14:08:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jWOSf-0008Ag-TH for bug-gnu-emacs@gnu.org; Wed, 06 May 2020 14:08:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Pip Cet Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 06 May 2020 18:08: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.158878843531357 (code B ref 40968); Wed, 06 May 2020 18:08:01 +0000 Original-Received: (at 40968) by debbugs.gnu.org; 6 May 2020 18:07:15 +0000 Original-Received: from localhost ([127.0.0.1]:41156 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jWORv-00089g-Ab for submit@debbugs.gnu.org; Wed, 06 May 2020 14:07:15 -0400 Original-Received: from mail-ot1-f44.google.com ([209.85.210.44]:45719) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jWORt-00089S-2q for 40968@debbugs.gnu.org; Wed, 06 May 2020 14:07:14 -0400 Original-Received: by mail-ot1-f44.google.com with SMTP id e20so2112634otk.12 for <40968@debbugs.gnu.org>; Wed, 06 May 2020 11:07:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=TqFecTA+r24vCr1dNBMw6erqiw+ipFF47fdvp/R13u0=; b=dv+A/vdjs0T4cDi5NQ7XnTWNyLBobvw3K6gJPrd6cZXz0rxNPjhWKq+duFPBZ9YABZ 3EHbvLcsIV8BpMjDFt4+2F2Ml6UwpNs/e7AWTdR9YJ1gAA5RXxF3eyQfxlKTY9FnmDTb TFv20V/4WERQRzuogyftGEOB8bMP9HfWTaHW41G1Z6XDtKMq9E7lfRKjwpIyjtTpmC8o SPFa8XOObCFFNwa8mIiVzKbXba4Mmplr4H9VkX+pODZcaeVB7B0d/G6Ot8JHmwXHdwH1 hRWriMix9VJjcFw4u3mBfFVn+Yh68fr2yY+TpFbiKJfN6xYANgUpMmUpEt9+dmKy7VGK PgDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TqFecTA+r24vCr1dNBMw6erqiw+ipFF47fdvp/R13u0=; b=U+wwI8QD95yginxT0kiMTQF4JWQy6pl/d3hXdsge3UDeBYps85kihJY15kmIF01I85 9j3kO8YQCh/Ok5IOoaqTfiaHLY4bMUCawpRxrBc3I0S9j741U+VwvzA7Ql0Hc3ZdE179 lYDCs5dMDPXG2N5ogmG836FEWrgbGoq/9R5P8BqDK46fkogVC+ihohffw3/4LfmTF5ic rccYk5oEH+S8YmjHn+0Qw5QvV1KHhGTKxjWDZgYqJ43f8Wx0sIoIW9CB6L5q4N7/X0fB QA40kTQ4rkLmfmtptoxuNok8yPcU+ddcxvJ5TjJYihGVPVco52VB0Hhf++NdlVjA8AVf QzdA== X-Gm-Message-State: AGi0Puaq8igzIxxfLdDBh/KDiQZMvyNG7cSvb0AS3AuXIF3hzQOp8obR BkcYznoycqFEJP3Ijo3qnIvP0xoCzTXHL9Y3cHU= X-Google-Smtp-Source: APiQypKCN1LRx5MhvMFYe6laAChyzYMQBlV38lM6FdVN9P1/HhL+70CuoojPGVdTTOUJJhH+1Njimr55nvDOzmZ0LEo= X-Received: by 2002:a9d:6b98:: with SMTP id b24mr7391337otq.287.1588788427453; Wed, 06 May 2020 11:07:07 -0700 (PDT) In-Reply-To: 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:179834 Archived-At: On Wed, May 6, 2020 at 3:28 PM Stefan Kangas wrote: > Pip Cet writes: > > Is the function signature relevant for anything but eldoc? > > Besides the docstring, the manual documents it. The suggested form is > unusual and makes it harder to understand, IMHO. I think it's hard to understand Elisp apply from a standard signature, because it's really (apply FUNCTION &rest INDIVIDUAL-ARGUMENTS ARGUMENT-LIST) or (apply FUNCTION-AND-ARGUMENT-LIST) The latter (which takes a single argument) is not a special case of the former (which takes 2,3,4,... arguments). > >> apply is fundamental to Lisp, and has been defined like this for a > >> long time. > > > > I don't know about that. Anything but the two-argument form of apply > > strikes me as rather dialect-dependent, but I may be wrong. > > If I understand correctly, you propose a three argument form: > > (apply FUNCTION ARGUMENT &rest ARGUMENTS) That's a 2,3,4...-argument form. > This is what I find unusual. It should really be either > > (apply FUNCTION &rest ARGUMENTS) That's a 1,2,3...-argument form. > or > > (apply FUNCTION ARGUMENTS) That's a 2-argument form. > But since we already have the former, we are better to stick with > that. > > Maybe there's a case to be made for a syntactic alternative to "&rest" > which disallows nil, which I guess is the issue here? But we can also > just signal an error in this case. > > Racket does the latter, as one data point: > > > (define foo (lambda () 1)) > > (apply foo nil) > ; nil: undefined; > ; cannot reference an identifier before its definition > ; in module: top-level > ; [,bt for context] Doesn't that just say that "nil" isn't a valid Racket identifier? (apply foo '()) works fine, and Racket's apply requires at least two arguments if I'm reading the error message correctly. > BTW, I don't see a big difference conceptually between '&rest > ARGUMENTS' and 'ARGUMENTS'. The former is just syntactic sugar, > right? Not really, no. > >> See the definition of "The Universal S-Function apply" in > >> John McCarthy's paper: [1] > >> > >> apply[f;args] =eval[cons[f;appq[args]];NIL], > > > > I must admit I don't know how appq is defined. (It turns out my PDF viewer just refused to highlight the definition right there on the page). > My point is mainly that it has two arguments: f and args. 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.