/[emacs]/emacs/lispref/functions.texi
ViewVC logotype

Diff of /emacs/lispref/functions.texi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.20 by JYavner, Sat Sep 28 18:45:54 2002 UTC revision 1.21 by lektu, Tue Feb 4 14:47:53 2003 UTC
# Line 1  Line 1 
1  @c -*-texinfo-*-  @c -*-texinfo-*-
2  @c This is part of the GNU Emacs Lisp Reference Manual.  @c This is part of the GNU Emacs Lisp Reference Manual.
3  @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999  @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999
4  @c   Free Software Foundation, Inc.  @c   Free Software Foundation, Inc.
5  @c See the file elisp.texi for copying conditions.  @c See the file elisp.texi for copying conditions.
6  @setfilename ../info/functions  @setfilename ../info/functions
7  @node Functions, Macros, Variables, Top  @node Functions, Macros, Variables, Top
# Line 18  define them. Line 18  define them.
18  * Defining Functions::    Lisp expressions for defining functions.  * Defining Functions::    Lisp expressions for defining functions.
19  * Calling Functions::     How to use an existing function.  * Calling Functions::     How to use an existing function.
20  * Mapping Functions::     Applying a function to each element of a list, etc.  * Mapping Functions::     Applying a function to each element of a list, etc.
21  * Anonymous Functions::   Lambda expressions are functions with no names.      * Anonymous Functions::   Lambda expressions are functions with no names.
22  * Function Cells::        Accessing or setting the function definition  * Function Cells::        Accessing or setting the function definition
23                              of a symbol.                              of a symbol.
24  * Inline Functions::      Defining functions that the compiler will open code.  * Inline Functions::      Defining functions that the compiler will open code.
# Line 746  length of @var{sequence}. Line 746  length of @var{sequence}.
746    "Apply FUNCTION to successive cars of all ARGS.    "Apply FUNCTION to successive cars of all ARGS.
747  Return the list of results."  Return the list of results."
748    ;; @r{If no list is exhausted,}    ;; @r{If no list is exhausted,}
749    (if (not (memq 'nil args))                  (if (not (memq 'nil args))
750        ;; @r{apply function to @sc{car}s.}        ;; @r{apply function to @sc{car}s.}
751        (cons (apply function (mapcar 'car args))          (cons (apply function (mapcar 'car args))
752              (apply 'mapcar* function                          (apply 'mapcar* function
753                     ;; @r{Recurse for rest of elements.}                     ;; @r{Recurse for rest of elements.}
754                     (mapcar 'cdr args)))))                     (mapcar 'cdr args)))))
755  @end group  @end group
# Line 779  The argument @var{function} must be a fu Line 779  The argument @var{function} must be a fu
779  argument and return a string.  The argument @var{sequence} can be any  argument and return a string.  The argument @var{sequence} can be any
780  kind of sequence except a char-table; that is, a list, a vector, a  kind of sequence except a char-table; that is, a list, a vector, a
781  bool-vector, or a string.  bool-vector, or a string.
782      
783  @smallexample  @smallexample
784  @group  @group
785  (mapconcat 'symbol-name  (mapconcat 'symbol-name
# Line 841  your program.  For example, you might wa Line 841  your program.  For example, you might wa
841  the function @code{mapcar}, which applies any given function to each  the function @code{mapcar}, which applies any given function to each
842  element of a list.  element of a list.
843    
844    Here we define a function @code{change-property} which    Here we define a function @code{change-property} which
845  uses a function as its third argument:  uses a function as its third argument:
846    
847  @example  @example
# Line 915  comment: Line 915  comment:
915    
916  @cindex @samp{#'} syntax  @cindex @samp{#'} syntax
917    The read syntax @code{#'} is a short-hand for using @code{function}.    The read syntax @code{#'} is a short-hand for using @code{function}.
918  For example,  For example,
919    
920  @example  @example
921  #'(lambda (x) (* x x))  #'(lambda (x) (* x x))

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26