From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#17623: 24.4.50; incorrect example for `apply-partially' in (elisp) `Calling Functions' Date: Fri, 22 Oct 2021 22:24:55 -0700 Message-ID: References: <9fd43ff1-d6cf-4ac6-b173-2fd634f45a98@default> <871tua2o12.fsf@web.de> <1ac7ebe5-6b43-4367-beb8-df7d9f5b6750@default> <87tx75ni8k.fsf@web.de> <8338ep6kk1.fsf@gnu.org> <87pphsor8h.fsf@web.de> <83tx746fgd.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12579"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Michael Heerdegen , 17623-done@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 23 07:26:16 2021 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 1me9Xr-00033O-4N for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 23 Oct 2021 07:26:15 +0200 Original-Received: from localhost ([::1]:58238 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1me9Xp-0001XF-Su for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 23 Oct 2021 01:26:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58932) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1me9Xh-0001N8-8p for bug-gnu-emacs@gnu.org; Sat, 23 Oct 2021 01:26:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50851) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1me9Xg-0005rM-30 for bug-gnu-emacs@gnu.org; Sat, 23 Oct 2021 01:26:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1me9Xf-0001F7-Vc for bug-gnu-emacs@gnu.org; Sat, 23 Oct 2021 01:26:03 -0400 Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Sat, 23 Oct 2021 05:26:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 17623 X-GNU-PR-Package: emacs Mail-Followup-To: 17623@debbugs.gnu.org, stefan@marxist.se, drew.adams@oracle.com Original-Received: via spool by 17623-done@debbugs.gnu.org id=D17623.16349667064632 (code D ref 17623); Sat, 23 Oct 2021 05:26:03 +0000 Original-Received: (at 17623-done) by debbugs.gnu.org; 23 Oct 2021 05:25:06 +0000 Original-Received: from localhost ([127.0.0.1]:34148 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1me9Wj-0001Ce-Ti for submit@debbugs.gnu.org; Sat, 23 Oct 2021 01:25:06 -0400 Original-Received: from mail-pl1-f177.google.com ([209.85.214.177]:40808) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1me9Wg-0001C3-33 for 17623-done@debbugs.gnu.org; Sat, 23 Oct 2021 01:25:03 -0400 Original-Received: by mail-pl1-f177.google.com with SMTP id v20so4167048plo.7 for <17623-done@debbugs.gnu.org>; Fri, 22 Oct 2021 22:25:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:in-reply-to:references:user-agent :mime-version:date:message-id:subject:to:cc; bh=R6tSNp7Vzt05kwbcxIgpbtdPvd7NTYMRWlLqE81UEZ4=; b=SeivKJiUm6xS3wf9wtfv7PmtHOr535bW2shVuTewdJkZw4//5UIfG9/LcdYWKlfwQe VgeNwNRS803Vsb+dQ7ktX3+Rwv8Q/w2AeGOX0sE5cFpx7W6YVfDFpCuX5Fb/4Oy/e8lh B+4j7zhQMcOTM/76hZotA9pTrD7i5caBOAVBHbNM9nFq/KlUgIjOzw0nkdTGQW3Tvkaa GpqzK7J5PXT1GQBVguC+abOV9W/wycjFsLJTH2SE2DeP+fphesb7EgcEHlgh4o7Ff6fL 1OC+e/dTmwyngyb2KgcJHaQstaCzpWH0ynr/XHLw0/hkdkskmhdHAXsAF/PhSDrA7Q4G 0ywQ== X-Gm-Message-State: AOAM533hD2xSVhyO858E/3ZEXOxbzC9IcX37Yo50JJIVc2Xw8ZgKFiyl /FwbIQX0DfVyYLMMXSf+IqufkBelZenL4tv1RYE= X-Google-Smtp-Source: ABdhPJzWL79PvGWwoLBN1Qs04b7mKdXUHea+BqsoSyRu1wC9M1n5Vy88dQtUARA5mSEDEHnfkN3fgvnE2fL2n3N+y1o= X-Received: by 2002:a17:902:c7c3:b0:140:2033:662c with SMTP id r3-20020a170902c7c300b001402033662cmr3664943pla.32.1634966696230; Fri, 22 Oct 2021 22:24:56 -0700 (PDT) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Fri, 22 Oct 2021 22:24:55 -0700 In-Reply-To: <83tx746fgd.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 28 Jun 2014 21:45:22 +0300") 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:217942 Archived-At: Eli Zaretskii writes: >> Say that >> >> (apply-partially f arg_1 ... arg_n) >> >> is equivalent to >> >> (lambda (&rest args) (apply f arg_1 ... arg_n args)) > > Sorry, I don't see how this is an improvement. > > Accidentally, the current text is a bit different from what you cited: > > -- Function: apply-partially func &rest args > This function returns a new function which, when called, will call > FUNC with the list of arguments composed from ARGS and additional > arguments specified at the time of the call. If FUNC accepts N > arguments, then a call to `apply-partially' with `M < N' arguments > will produce a new function of `N - M' arguments. > >> And I think that the paragraph about `apply-partially` should be merged >> into the later text talking about functionals, because the main use case >> of `apply-partially` is to construct anonymous functions for usage as >> argument to some other function. > > If you mean this: > > It is common for Lisp functions to accept functions as arguments or > find them in data structures (especially in hook variables and property > lists) and call them using `funcall' or `apply'. Functions that accept > function arguments are often called "functionals". > > Sometimes, when you call a functional, it is useful to supply a no-op > function as the argument. Here are two different kinds of no-op > function: > > then it directly follows the part we were talking about. There was a discussion here about how to improve the 'apply-partially' documentation, but it didn't yield any concrete suggestions for improvements. I read the text we have now, and I find it clear with regards to the questions raised in this thread, so I'm closing this bug report. If this conclusion is incorrect and this is still an issue, please reply to this email (use "Reply to all" in your email client) and we might reconsider. We are more likely to reconsider if such a request comes with a concrete suggestion for how to improve this text, preferably in the form of a patch. Thanks.