Commit 834b5485 authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

(Calling Functions): Use `defalias' instead of `fset'. Fix wording.

parent 10e187e8
......@@ -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:
(fset 'incr-by-one (apply-partially '+ 1))
(incr-by-one 10)
(defalias '1+ (apply-partially '+ 1)
"Increment argument by one.")
@end group
(1+ 10)
@result{} 11
@end group
@end example
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment