comparison man/cl.texi @ 442:abe6d1db359e r21-2-36

Import from CVS: tag r21-2-36
author cvs
date Mon, 13 Aug 2007 11:35:02 +0200
parents 8de8e3f6228a
children 1ccc32a20af4
comparison
equal deleted inserted replaced
441:72a7cfa4a488 442:abe6d1db359e
3216 Emacs 19. 3216 Emacs 19.
3217 3217
3218 @example 3218 @example
3219 (declaim (inline foo bar)) 3219 (declaim (inline foo bar))
3220 (eval-when (compile load eval) (proclaim '(inline foo bar))) 3220 (eval-when (compile load eval) (proclaim '(inline foo bar)))
3221 (proclaim-inline foo bar) ; XEmacs only 3221 (proclaim-inline foo bar) ; XEmacs only
3222 (defsubst foo (...) ...) ; instead of defun; Emacs 19 only 3222 (defsubst foo (...) ...) ; instead of defun; Emacs 19 only
3223 @end example 3223 @end example
3224 3224
3225 @strong{Please note:} This declaration remains in effect after the 3225 @strong{Please note:} This declaration remains in effect after the
3226 containing source file is done. It is correct to use it to 3226 containing source file is done. It is correct to use it to
3227 request that a function you have defined should be inlined, 3227 request that a function you have defined should be inlined,
3295 @noindent 3295 @noindent
3296 This package defines several symbol-related features that were 3296 This package defines several symbol-related features that were
3297 missing from Emacs Lisp. 3297 missing from Emacs Lisp.
3298 3298
3299 @menu 3299 @menu
3300 * Property Lists:: `remprop', `getf', `remf' 3300 * Property Lists:: `getf', `remf'
3301 * Creating Symbols:: `gensym', `gentemp' 3301 * Creating Symbols:: `gensym', `gentemp'
3302 @end menu 3302 @end menu
3303 3303
3304 @node Property Lists, Creating Symbols, Symbols, Symbols 3304 @node Property Lists, Creating Symbols, Symbols, Symbols
3305 @section Property Lists 3305 @section Property Lists
3306 3306
3307 @noindent 3307 @noindent
3308 These functions augment the standard Emacs Lisp functions @code{get} 3308 These functions augment the standard Emacs Lisp functions @code{get}
3309 and @code{put} for operating on properties attached to symbols. 3309 and @code{put} for operating on properties attached to objects.
3310 There are also functions for working with property lists as 3310 There are also functions for working with property lists as
3311 first-class data structures not attached to particular symbols. 3311 first-class data structures not attached to particular objects.
3312
3313 @defun remprop symbol property
3314 This function removes the entry for @var{property} from the property
3315 list of @var{symbol}. It returns a true value if the property was
3316 indeed found and removed, or @code{nil} if there was no such property.
3317 (This function was probably omitted from Emacs originally because,
3318 since @code{get} did not allow a @var{default}, it was very difficult
3319 to distinguish between a missing property and a property whose value
3320 was @code{nil}; thus, setting a property to @code{nil} was close
3321 enough to @code{remprop} for most purposes.)
3322 @end defun
3323 3312
3324 @defun getf place property &optional default 3313 @defun getf place property &optional default
3325 This function scans the list @var{place} as if it were a property 3314 This function scans the list @var{place} as if it were a property
3326 list, i.e., a list of alternating property names and values. If 3315 list, i.e., a list of alternating property names and values. If
3327 an even-numbered element of @var{place} is found which is @code{eq} 3316 an even-numbered element of @var{place} is found which is @code{eq}
5558 In Common Lisp, one traditionally uses @code{#'} notation when 5547 In Common Lisp, one traditionally uses @code{#'} notation when
5559 referring to the name of a function. In Emacs Lisp, it works 5548 referring to the name of a function. In Emacs Lisp, it works
5560 just as well to use a regular quote: 5549 just as well to use a regular quote:
5561 5550
5562 @example 5551 @example
5563 (loop for x in y by #'cddr collect (mapcar #'plusp x)) ; Common Lisp 5552 (loop for x in y by #'cddr collect (mapcar #'plusp x)) ; Common Lisp
5564 (loop for x in y by 'cddr collect (mapcar 'plusp x)) ; Emacs Lisp 5553 (loop for x in y by 'cddr collect (mapcar 'plusp x)) ; Emacs Lisp
5565 @end example 5554 @end example
5566 5555
5567 When @code{#'} introduces a @code{lambda} form, it is best to 5556 When @code{#'} introduces a @code{lambda} form, it is best to
5568 write out @code{(function ...)} longhand in Emacs Lisp. You can 5557 write out @code{(function ...)} longhand in Emacs Lisp. You can
5569 use a regular quote, but then the byte-compiler won't know that 5558 use a regular quote, but then the byte-compiler won't know that