comparison man/cl.texi @ 36931:508fd85ab816

expurgate last*
author Dave Love <fx@gnu.org>
date Wed, 21 Mar 2001 20:58:57 +0000
parents bc14e9ea5378
children e9ca70d27e37
comparison
equal deleted inserted replaced
36930:ac0ad12128b7 36931:508fd85ab816
278 @example 278 @example
279 defun* defsubst* defmacro* function* 279 defun* defsubst* defmacro* function*
280 member* assoc* rassoc* get* 280 member* assoc* rassoc* get*
281 remove* delete* mapcar* sort* 281 remove* delete* mapcar* sort*
282 floor* ceiling* truncate* round* 282 floor* ceiling* truncate* round*
283 mod* rem* random* last* 283 mod* rem* random*
284 @end example 284 @end example
285 285
286 Internal function and variable names in the package are prefixed 286 Internal function and variable names in the package are prefixed
287 by @code{cl-}. Here is a complete list of functions @emph{not} 287 by @code{cl-}. Here is a complete list of functions @emph{not}
288 prefixed by @code{cl-} which were not taken from Common Lisp: 288 prefixed by @code{cl-} which were not taken from Common Lisp:
3793 that it passes in the list pointers themselves rather than the 3793 that it passes in the list pointers themselves rather than the
3794 @code{car}s of the advancing pointers. 3794 @code{car}s of the advancing pointers.
3795 @end defun 3795 @end defun
3796 3796
3797 @defun mapc function seq &rest more-seqs 3797 @defun mapc function seq &rest more-seqs
3798 This function is like @code{mapcar*}, except that the values 3798 This function is like @code{mapcar*}, except that the values returned
3799 returned by @var{function} are ignored and thrown away rather 3799 by @var{function} are ignored and thrown away rather than being
3800 than being collected into a list. The return value of @code{mapc} 3800 collected into a list. The return value of @code{mapc} is @var{seq},
3801 is @var{seq}, the first sequence. 3801 the first sequence. This function is more general than the Emacs
3802 primitive @code{mapc}.
3802 @end defun 3803 @end defun
3803 3804
3804 @defun mapl function list &rest more-lists 3805 @defun mapl function list &rest more-lists
3805 This function is like @code{maplist}, except that it throws away 3806 This function is like @code{maplist}, except that it throws away
3806 the values returned by @var{function}. 3807 the values returned by @var{function}.
4145 4146
4146 @noindent 4147 @noindent
4147 The functions described here operate on lists. 4148 The functions described here operate on lists.
4148 4149
4149 @menu 4150 @menu
4150 * List Functions:: `caddr', `first', `last*', `list*', etc. 4151 * List Functions:: `caddr', `first', `list*', etc.
4151 * Substitution of Expressions:: `subst', `sublis', etc. 4152 * Substitution of Expressions:: `subst', `sublis', etc.
4152 * Lists as Sets:: `member*', `adjoin', `union', etc. 4153 * Lists as Sets:: `member*', `adjoin', `union', etc.
4153 * Association Lists:: `assoc*', `rassoc*', `acons', `pairlis' 4154 * Association Lists:: `assoc*', `rassoc*', `acons', `pairlis'
4154 @end menu 4155 @end menu
4155 4156
4189 This function returns the length of list @var{x}, exactly like 4190 This function returns the length of list @var{x}, exactly like
4190 @code{(length @var{x})}, except that if @var{x} is a circular 4191 @code{(length @var{x})}, except that if @var{x} is a circular
4191 list (where the cdr-chain forms a loop rather than terminating 4192 list (where the cdr-chain forms a loop rather than terminating
4192 with @code{nil}), this function returns @code{nil}. (The regular 4193 with @code{nil}), this function returns @code{nil}. (The regular
4193 @code{length} function would get stuck if given a circular list.) 4194 @code{length} function would get stuck if given a circular list.)
4194 @end defun
4195
4196 @defun last* x &optional n
4197 This function returns the last cons, or the @var{n}th-to-last cons,
4198 of the list @var{x}. If @var{n} is omitted it defaults to 1.
4199 The ``last cons'' means the first cons cell of the list whose
4200 @code{cdr} is not another cons cell. (For normal lists, the
4201 @code{cdr} of the last cons will be @code{nil}.) This function
4202 returns @code{nil} if @var{x} is @code{nil} or shorter than
4203 @var{n}. Note that the last @emph{element} of the list is
4204 @code{(car (last @var{x}))}.
4205
4206 The Emacs function @code{last} does the same thing
4207 except that it does not handle the optional argument @var{n}.
4208 @end defun 4195 @end defun
4209 4196
4210 @defun list* arg &rest others 4197 @defun list* arg &rest others
4211 This function constructs a list of its arguments. The final 4198 This function constructs a list of its arguments. The final
4212 argument becomes the @code{cdr} of the last cell constructed. 4199 argument becomes the @code{cdr} of the last cell constructed.