From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#17623: 24.4.50; incorrect example for `apply-partially' in (elisp) `Calling Functions' Date: Sat, 28 Jun 2014 21:45:22 +0300 Message-ID: <83tx746fgd.fsf@gnu.org> 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> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1403981187 536 80.91.229.3 (28 Jun 2014 18:46:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 28 Jun 2014 18:46:27 +0000 (UTC) Cc: 17623@debbugs.gnu.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jun 28 20:46:19 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1X0xdi-0005vf-VU for geb-bug-gnu-emacs@m.gmane.org; Sat, 28 Jun 2014 20:46:19 +0200 Original-Received: from localhost ([::1]:55570 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0xdi-0007hj-Kf for geb-bug-gnu-emacs@m.gmane.org; Sat, 28 Jun 2014 14:46:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40282) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0xdZ-0007gh-Au for bug-gnu-emacs@gnu.org; Sat, 28 Jun 2014 14:46:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X0xdT-0001qy-4V for bug-gnu-emacs@gnu.org; Sat, 28 Jun 2014 14:46:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45173) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0xdT-0001qo-0i for bug-gnu-emacs@gnu.org; Sat, 28 Jun 2014 14:46:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1X0xdS-0002Op-Hu for bug-gnu-emacs@gnu.org; Sat, 28 Jun 2014 14:46:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 28 Jun 2014 18:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17623 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 17623-submit@debbugs.gnu.org id=B17623.14039811459194 (code B ref 17623); Sat, 28 Jun 2014 18:46:02 +0000 Original-Received: (at 17623) by debbugs.gnu.org; 28 Jun 2014 18:45:45 +0000 Original-Received: from localhost ([127.0.0.1]:36323 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X0xdA-0002OE-7P for submit@debbugs.gnu.org; Sat, 28 Jun 2014 14:45:44 -0400 Original-Received: from mtaout25.012.net.il ([80.179.55.181]:52998) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X0xd5-0002Nk-4M for 17623@debbugs.gnu.org; Sat, 28 Jun 2014 14:45:41 -0400 Original-Received: from conversion-daemon.mtaout25.012.net.il by mtaout25.012.net.il (HyperSendmail v2007.08) id <0N7W00D00621IN00@mtaout25.012.net.il> for 17623@debbugs.gnu.org; Sat, 28 Jun 2014 21:41:31 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout25.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N7W00D2K6L7OG20@mtaout25.012.net.il>; Sat, 28 Jun 2014 21:41:31 +0300 (IDT) In-reply-to: <87pphsor8h.fsf@web.de> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:90948 Archived-At: > From: Michael Heerdegen > Cc: 17623@debbugs.gnu.org > Date: Sat, 28 Jun 2014 19:53:34 +0200 > > There's nothing wrong per see in the current text, but it sounds as if > `apply-partially` would somehow analyze the argument list of its first > argument. Where does it say that? It says the result is a new function that will call the original with all the arguments combined. There's nothing about analysis in that text. > 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.