GNU bug report logs - #17623
24.4.50; incorrect example for `apply-partially' in (elisp) `Calling Functions'

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Wed, 28 May 2014 23:55:01 UTC

Severity: minor

Found in version 24.4.50

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 17623-done <at> debbugs.gnu.org, stefan <at> marxist.se
Subject: bug#17623: 24.4.50; incorrect example for `apply-partially' in (elisp) `Calling Functions'
Date: Sat, 23 Oct 2021 14:39:02 +0300
> From: Michael Heerdegen <michael_heerdegen <at> web.de>
> Cc: Eli Zaretskii <eliz <at> gnu.org>,  17623-done <at> debbugs.gnu.org
> Date: Sat, 23 Oct 2021 11:44:21 +0200
> 
> I disagree.  The paragraph in the manual explains what the arity of the
> function returned by `apply-partially' would be.
> 
> Directly following is an example suggesting that (apply-partially '+ 1)
> is equivalent to #'1+ - which obviously contradicts that preceding
> paragraph.

In what sense is that a contradiction?  (+ 1 10) is equivalent to (1+ 10),
so we have N = 2 arguments in the original function and M = 1 = N - 1 in
the new one.

> I'm a bit confused that you don't consider this a problem, and also that
> you said there were no concrete suggestions.

That suggestion doesn't make the documentation more clear, IMNSHO,
unless the reader already knows about apply-partially and generally
has a lot of background knowledge about Lisp and Emacs Lisp.  Why are
you saying the suggestion is not being considered, whereas in reality
it was considered (and rejected)?

> There were concrete suggestions for improvements.  One was to simply
> spell out the function that is constructed.  It is only one line, and
> would make the semantics clear.

I cannot disagree more.  That one line doesn't make anything clear, it
just shows the implementation.

> BTW, whenever I posted an example using `apply-partially', Stefan told
> me that it would be more efficient to write out the lambda.  That aspect
> could also be covered: when is worth using?

Concrete proposals for expanding the documentation of apply-partially
(read: patches) will be most welcome, of course.

> Or delete that paragraph, better to say nothing than to confuse readers.

I object to deleting that.  That text certainly helps me, so it cannot
be useless, let alone harmful.




This bug report was last modified 3 years and 262 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.