bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#17623: 24.4.50; incorrect example for `apply-partially' in (elisp) `


From: Drew Adams
Subject: bug#17623: 24.4.50; incorrect example for `apply-partially' in (elisp) `Calling Functions'
Date: Wed, 28 May 2014 16:53:35 -0700 (PDT)

The text states incorrectly that the example defines an equivalent of
built-in function `1+', but it does not.  The function defined in the
example is equivalent to this one, which is not equivalent to `1+':

(defun 1+-sum (&rest args)
 "Return one more than the sum of the args."
 (1+ (apply #'+ args)))

This function accepts any number of args, including zero.
`1+' requires a single arg.

As it stands, this example is liable to confuse more than help.

In GNU Emacs 24.4.50.1 (i686-pc-mingw32)
 of 2014-05-25 on ODIEONE
Bzr revision: 117153 tsdh@gnu.org-20140525174054-vzeh4zeg00a1ley8
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --prefix=/c/Devel/emacs/snapshot/trunk
 --enable-checking=yes,glyphs 'CFLAGS=-O0 -g3'
 LDFLAGS=-Lc:/Devel/emacs/lib 'CPPFLAGS=-DGC_MCHECK=1
 -Ic:/Devel/emacs/include''





reply via email to

[Prev in Thread] Current Thread [Next in Thread]