summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2008-10-21 09:21:02 +0000
committerEli Zaretskii <eliz@gnu.org>2008-10-21 09:21:02 +0000
commitc59da8ed6a8b5d068afdbd027dbfe54a107b091a (patch)
tree3beb2a3380f6ab31e5f320757e5a9bdf22682f1e
parent10aff0daf57217e711e82ad828fc78284cf8e5ef (diff)
downloademacs-c59da8ed6a8b5d068afdbd027dbfe54a107b091a.tar.gz
(Calling Functions): Use `defalias' instead of `fset'. Fix wording.
-rw-r--r--doc/lispref/functions.texi13
1 files changed, 8 insertions, 5 deletions
diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi
index e420e932fc7..e64cc030d6d 100644
--- a/doc/lispref/functions.texi
+++ b/doc/lispref/functions.texi
@@ -749,14 +749,17 @@ accepts @var{n} arguments, then a call to @code{apply-partially} with
@w{@code{@var{m} < @var{n}}} arguments will produce a new function of
@w{@code{@var{n} - @var{m}}} arguments.
-Here's an example of using @code{apply-partially} to produce a variant
-of the Emacs Lisp primitive @code{1+}, a function that increments its
-argument by one, based on the primitive @code{+}:
+Here's how we could define the built-in function @code{1+}, if it
+didn't exist, using @code{apply-partially} and @code{+}, another
+built-in function:
@example
-(fset 'incr-by-one (apply-partially '+ 1))
@group
-(incr-by-one 10)
+(defalias '1+ (apply-partially '+ 1)
+ "Increment argument by one.")
+@end group
+@group
+(1+ 10)
@result{} 11
@end group
@end example