Mercurial > hg > xemacs-beta
diff man/cl.texi @ 412:697ef44129c6 r21-2-14
Import from CVS: tag r21-2-14
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:20:41 +0200 |
parents | a86b2b5e0111 |
children |
line wrap: on
line diff
--- a/man/cl.texi Mon Aug 13 11:19:22 2007 +0200 +++ b/man/cl.texi Mon Aug 13 11:20:41 2007 +0200 @@ -295,10 +295,10 @@ @example defun* defsubst* defmacro* function* -member* assoc* rassoc* remove* -delete* mapcar* sort* floor* -ceiling* truncate* round* mod* -rem* random* +member* assoc* rassoc* get* +remove* delete* mapcar* sort* +floor* ceiling* truncate* round* +mod* rem* random* @end example Internal function and variable names in the package are prefixed @@ -1084,8 +1084,8 @@ nth rest first .. tenth aref elt nthcdr symbol-function symbol-value symbol-plist -get getf gethash -subseq +get get* getf +gethash subseq @end smallexample @noindent @@ -3218,8 +3218,8 @@ @example (declaim (inline foo bar)) (eval-when (compile load eval) (proclaim '(inline foo bar))) -(proclaim-inline foo bar) ; XEmacs only -(defsubst foo (...) ...) ; instead of defun; Emacs 19 only +(proclaim-inline foo bar) ; XEmacs only +(defsubst foo (...) ...) ; instead of defun; Emacs 19 only @end example @strong{Please note:} This declaration remains in effect after the @@ -3297,7 +3297,7 @@ missing from Emacs Lisp. @menu -* Property Lists:: `getf', `remf' +* Property Lists:: `get*', `remprop', `getf', `remf' * Creating Symbols:: `gensym', `gentemp' @end menu @@ -3306,9 +3306,31 @@ @noindent These functions augment the standard Emacs Lisp functions @code{get} -and @code{put} for operating on properties attached to objects. +and @code{put} for operating on properties attached to symbols. There are also functions for working with property lists as -first-class data structures not attached to particular objects. +first-class data structures not attached to particular symbols. + +@defun get* symbol property &optional default +This function is like @code{get}, except that if the property is +not found, the @var{default} argument provides the return value. +(The Emacs Lisp @code{get} function always uses @code{nil} as +the default; this package's @code{get*} is equivalent to Common +Lisp's @code{get}.) + +The @code{get*} function is @code{setf}-able; when used in this +fashion, the @var{default} argument is allowed but ignored. +@end defun + +@defun remprop symbol property +This function removes the entry for @var{property} from the property +list of @var{symbol}. It returns a true value if the property was +indeed found and removed, or @code{nil} if there was no such property. +(This function was probably omitted from Emacs originally because, +since @code{get} did not allow a @var{default}, it was very difficult +to distinguish between a missing property and a property whose value +was @code{nil}; thus, setting a property to @code{nil} was close +enough to @code{remprop} for most purposes.) +@end defun @defun getf place property &optional default This function scans the list @var{place} as if it were a property @@ -3335,11 +3357,11 @@ (put sym prop val) @equiv{} (setf (getf (symbol-plist sym) prop) val) @end example -The @code{get} function is also @code{setf}-able. The fact that -@code{default} is ignored can sometimes be useful: +The @code{get} and @code{get*} functions are also @code{setf}-able. +The fact that @code{default} is ignored can sometimes be useful: @example -(incf (get 'foo 'usage-count 0)) +(incf (get* 'foo 'usage-count 0)) @end example Here, symbol @code{foo}'s @code{usage-count} property is incremented @@ -4631,7 +4653,7 @@ does not already exist, a new entry is added to the table and the table is reallocated to a larger size if necessary. The @var{default} argument is allowed but ignored in this case. The situation is -exactly analogous to that of @code{get}; @pxref{Property Lists}. +exactly analogous to that of @code{get*}; @pxref{Property Lists}. @end defun @defun remhash key table @@ -5549,8 +5571,8 @@ just as well to use a regular quote: @example -(loop for x in y by #'cddr collect (mapcar #'plusp x)) ; Common Lisp -(loop for x in y by 'cddr collect (mapcar 'plusp x)) ; Emacs Lisp +(loop for x in y by #'cddr collect (mapcar #'plusp x)) ; Common Lisp +(loop for x in y by 'cddr collect (mapcar 'plusp x)) ; Emacs Lisp @end example When @code{#'} introduces a @code{lambda} form, it is best to