diff options
| author | Glenn Morris | 2012-10-23 00:43:39 -0700 |
|---|---|---|
| committer | Glenn Morris | 2012-10-23 00:43:39 -0700 |
| commit | 8d6510b95a6bde1e605da1bc5e582dab06cff51d (patch) | |
| tree | da7607fa0d24b628286557168ddcf82fdeabd440 | |
| parent | 49238e7f5c081b841bdc57d96599c4997dcb487c (diff) | |
| download | emacs-8d6510b95a6bde1e605da1bc5e582dab06cff51d.tar.gz emacs-8d6510b95a6bde1e605da1bc5e582dab06cff51d.zip | |
Start updating cl.texi for cl-lib changes
* doc/misc/cl.texi: Include emacsver.texi.
Use Emacs version number rather than unchanging cl.el version number.
End all menu descriptions with a period.
Do not use @dfn{CL} for every instance of "CL".
(Overview): Remove no-runtime caveat, and note about foo* names.
(Usage): Use cl-lib rather than cl.
(Organization, Naming Conventions): Update for cl-lib.el.
(Installation): Remove long-irrelevant node.
(Program Structure, Predicates, Control Structure):
Start updating for cl-lib namespace.
* doc/misc/Makefile.in ($(buildinfodir)/cl$(INFO_EXT), cl.dvi, cl.pdf):
Depend on emacsver.texi.
| -rw-r--r-- | doc/misc/ChangeLog | 16 | ||||
| -rw-r--r-- | doc/misc/Makefile.in | 6 | ||||
| -rw-r--r-- | doc/misc/cl.texi | 425 |
3 files changed, 219 insertions, 228 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 3ee183ff255..6f70139df58 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog | |||
| @@ -1,3 +1,19 @@ | |||
| 1 | 2012-10-23 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * cl.texi: Include emacsver.texi. Use Emacs version number rather | ||
| 4 | than unchanging cl.el version number. | ||
| 5 | End all menu descriptions with a period. | ||
| 6 | Do not use @dfn{CL} for every instance of "CL". | ||
| 7 | (Overview): Remove no-runtime caveat, and note about foo* names. | ||
| 8 | (Usage): Use cl-lib rather than cl. | ||
| 9 | (Organization, Naming Conventions): Update for cl-lib.el. | ||
| 10 | (Installation): Remove long-irrelevant node. | ||
| 11 | (Program Structure, Predicates, Control Structure): | ||
| 12 | Start updating for cl-lib namespace. | ||
| 13 | |||
| 14 | * Makefile.in ($(buildinfodir)/cl$(INFO_EXT), cl.dvi, cl.pdf): | ||
| 15 | Depend on emacsver.texi. | ||
| 16 | |||
| 1 | 2012-10-09 Michael Albinus <michael.albinus@gmx.de> | 17 | 2012-10-09 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 18 | ||
| 3 | * trampver.texi: Update release number. | 19 | * trampver.texi: Update release number. |
diff --git a/doc/misc/Makefile.in b/doc/misc/Makefile.in index 5ce6d82e683..ea1e87333bd 100644 --- a/doc/misc/Makefile.in +++ b/doc/misc/Makefile.in | |||
| @@ -237,12 +237,12 @@ cc-mode.pdf: ${srcdir}/cc-mode.texi | |||
| 237 | $(ENVADD) $(TEXI2PDF) ${srcdir}/cc-mode.texi | 237 | $(ENVADD) $(TEXI2PDF) ${srcdir}/cc-mode.texi |
| 238 | 238 | ||
| 239 | cl : $(buildinfodir)/cl$(INFO_EXT) | 239 | cl : $(buildinfodir)/cl$(INFO_EXT) |
| 240 | $(buildinfodir)/cl$(INFO_EXT): ${srcdir}/cl.texi | 240 | $(buildinfodir)/cl$(INFO_EXT): ${srcdir}/cl.texi $(emacsdir)/emacsver.texi |
| 241 | $(mkinfodir) | 241 | $(mkinfodir) |
| 242 | $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/cl.texi | 242 | $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/cl.texi |
| 243 | cl.dvi: ${srcdir}/cl.texi | 243 | cl.dvi: ${srcdir}/cl.texi $(emacsdir)/emacsver.texi |
| 244 | $(ENVADD) $(TEXI2DVI) ${srcdir}/cl.texi | 244 | $(ENVADD) $(TEXI2DVI) ${srcdir}/cl.texi |
| 245 | cl.pdf: ${srcdir}/cl.texi | 245 | cl.pdf: ${srcdir}/cl.texi $(emacsdir)/emacsver.texi |
| 246 | $(ENVADD) $(TEXI2PDF) ${srcdir}/cl.texi | 246 | $(ENVADD) $(TEXI2PDF) ${srcdir}/cl.texi |
| 247 | 247 | ||
| 248 | dbus : $(buildinfodir)/dbus$(INFO_EXT) | 248 | dbus : $(buildinfodir)/dbus$(INFO_EXT) |
diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index 18abb0647a2..12fd76e2e1c 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | \input texinfo @c -*-texinfo-*- | 1 | \input texinfo @c -*-texinfo-*- |
| 2 | @setfilename ../../info/cl | 2 | @setfilename ../../info/cl |
| 3 | @settitle Common Lisp Extensions | 3 | @settitle Common Lisp Extensions |
| 4 | @include emacsver.texi | ||
| 4 | 5 | ||
| 5 | @copying | 6 | @copying |
| 6 | This file documents the GNU Emacs Common Lisp emulation package. | 7 | This file documents the GNU Emacs Common Lisp emulation package. |
| @@ -34,7 +35,7 @@ developing GNU and promoting software freedom.'' | |||
| 34 | @sp 4 | 35 | @sp 4 |
| 35 | @center For GNU Emacs Lisp | 36 | @center For GNU Emacs Lisp |
| 36 | @sp 1 | 37 | @sp 1 |
| 37 | @center Version 2.02 | 38 | @center as distributed with Emacs @value{EMACSVER} |
| 38 | @sp 5 | 39 | @sp 5 |
| 39 | @center Dave Gillespie | 40 | @center Dave Gillespie |
| 40 | @center daveg@@synaptics.com | 41 | @center daveg@@synaptics.com |
| @@ -53,23 +54,23 @@ developing GNU and promoting software freedom.'' | |||
| 53 | @end ifnottex | 54 | @end ifnottex |
| 54 | 55 | ||
| 55 | @menu | 56 | @menu |
| 56 | * Overview:: Installation, usage, etc. | 57 | * Overview:: Basics, usage, etc. |
| 57 | * Program Structure:: Arglists, @code{eval-when}, @code{defalias} | 58 | * Program Structure:: Arglists, @code{cl-eval-when}, @code{defalias}. |
| 58 | * Predicates:: @code{typep} and @code{equalp} | 59 | * Predicates:: @code{cl-typep} and @code{cl-equalp}. |
| 59 | * Control Structure:: @code{setf}, @code{do}, @code{loop}, etc. | 60 | * Control Structure:: @code{setf}, @code{cl-do}, @code{cl-loop}, etc. |
| 60 | * Macros:: Destructuring, @code{define-compiler-macro} | 61 | * Macros:: Destructuring, @code{cl-define-compiler-macro}. |
| 61 | * Declarations:: @code{proclaim}, @code{declare}, etc. | 62 | * Declarations:: @code{cl-proclaim}, @code{cl-declare}, etc. |
| 62 | * Symbols:: Property lists, @code{gensym} | 63 | * Symbols:: Property lists, @code{cl-gensym}. |
| 63 | * Numbers:: Predicates, functions, random numbers | 64 | * Numbers:: Predicates, functions, random numbers. |
| 64 | * Sequences:: Mapping, functions, searching, sorting | 65 | * Sequences:: Mapping, functions, searching, sorting. |
| 65 | * Lists:: @code{caddr}, @code{sublis}, @code{member*}, @code{assoc*}, etc. | 66 | * Lists:: @code{cl-caddr}, @code{cl-sublis}, @code{cl-member}, @code{cl-assoc}, etc. |
| 66 | * Structures:: @code{defstruct} | 67 | * Structures:: @code{cl-defstruct}. |
| 67 | * Assertions:: @code{check-type}, @code{assert}, @code{ignore-errors}. | 68 | * Assertions:: @code{cl-check-type}, @code{cl-assert}, @code{ignore-errors}. |
| 68 | 69 | ||
| 69 | * Efficiency Concerns:: Hints and techniques | 70 | * Efficiency Concerns:: Hints and techniques. |
| 70 | * Common Lisp Compatibility:: All known differences with Steele | 71 | * Common Lisp Compatibility:: All known differences with Steele. |
| 71 | * Old CL Compatibility:: All known differences with old cl.el | 72 | * Old CL Compatibility:: All known differences with old cl.el. |
| 72 | * Porting Common Lisp:: Hints for porting Common Lisp code | 73 | * Porting Common Lisp:: Hints for porting Common Lisp code. |
| 73 | 74 | ||
| 74 | * GNU Free Documentation License:: The license for this documentation. | 75 | * GNU Free Documentation License:: The license for this documentation. |
| 75 | * Function Index:: | 76 | * Function Index:: |
| @@ -92,21 +93,11 @@ As Emacs Lisp programmers have grown in number, and the applications | |||
| 92 | they write have grown more ambitious, it has become clear that Emacs | 93 | they write have grown more ambitious, it has become clear that Emacs |
| 93 | Lisp could benefit from many of the conveniences of Common Lisp. | 94 | Lisp could benefit from many of the conveniences of Common Lisp. |
| 94 | 95 | ||
| 95 | The @dfn{CL} package adds a number of Common Lisp functions and | 96 | The @code{CL} package adds a number of Common Lisp functions and |
| 96 | control structures to Emacs Lisp. While not a 100% complete | 97 | control structures to Emacs Lisp. While not a 100% complete |
| 97 | implementation of Common Lisp, @dfn{CL} adds enough functionality | 98 | implementation of Common Lisp, @code{CL} adds enough functionality |
| 98 | to make Emacs Lisp programming significantly more convenient. | 99 | to make Emacs Lisp programming significantly more convenient. |
| 99 | 100 | ||
| 100 | @strong{Please note:} the @dfn{CL} functions are not standard parts of | ||
| 101 | the Emacs Lisp name space, so it is legitimate for users to define | ||
| 102 | them with other, conflicting meanings. To avoid conflicting with | ||
| 103 | those user activities, we have a policy that packages installed in | ||
| 104 | Emacs must not load @dfn{CL} at run time. (It is ok for them to load | ||
| 105 | @dfn{CL} at compile time only, with @code{eval-when-compile}, and use | ||
| 106 | the macros it provides.) If you are writing packages that you plan to | ||
| 107 | distribute and invite widespread use for, you might want to observe | ||
| 108 | the same rule. | ||
| 109 | |||
| 110 | Some Common Lisp features have been omitted from this package | 101 | Some Common Lisp features have been omitted from this package |
| 111 | for various reasons: | 102 | for various reasons: |
| 112 | 103 | ||
| @@ -119,152 +110,131 @@ examples of this group. | |||
| 119 | @item | 110 | @item |
| 120 | Other features cannot be implemented without modification to the | 111 | Other features cannot be implemented without modification to the |
| 121 | Emacs Lisp interpreter itself, such as multiple return values, | 112 | Emacs Lisp interpreter itself, such as multiple return values, |
| 122 | lexical scoping, case-insensitive symbols, and complex numbers. | 113 | case-insensitive symbols, and complex numbers. |
| 123 | The @dfn{CL} package generally makes no attempt to emulate these | 114 | The @code{CL} package generally makes no attempt to emulate these |
| 124 | features. | 115 | features. |
| 125 | 116 | ||
| 126 | @item | ||
| 127 | Some features conflict with existing things in Emacs Lisp. For | ||
| 128 | example, Emacs's @code{assoc} function is incompatible with the | ||
| 129 | Common Lisp @code{assoc}. In such cases, this package usually | ||
| 130 | adds the suffix @samp{*} to the function name of the Common | ||
| 131 | Lisp version of the function (e.g., @code{assoc*}). | ||
| 132 | @end itemize | 117 | @end itemize |
| 133 | 118 | ||
| 134 | The package described here was written by Dave Gillespie, | 119 | The package described here was originally written by Dave Gillespie, |
| 135 | @file{daveg@@synaptics.com}. It is a total rewrite of the original | 120 | @file{daveg@@synaptics.com}, as a total rewrite of an earlier |
| 136 | 1986 @file{cl.el} package by Cesar Quiroz. Most features of the | 121 | 1986 @file{cl.el} package by Cesar Quiroz. Most features of the |
| 137 | Quiroz package have been retained; any incompatibilities are | 122 | Quiroz package were retained; any incompatibilities are |
| 138 | noted in the descriptions below. Care has been taken in this | 123 | noted in the descriptions below. Care has been taken in this |
| 139 | version to ensure that each function is defined efficiently, | 124 | version to ensure that each function is defined efficiently, |
| 140 | concisely, and with minimal impact on the rest of the Emacs | 125 | concisely, and with minimal impact on the rest of the Emacs |
| 141 | environment. | 126 | environment. Stefan Monnier added the file @file{cl-lib.el} and |
| 127 | rationalized the namespace for Emacs 24.3. | ||
| 142 | 128 | ||
| 143 | @menu | 129 | @menu |
| 144 | * Usage:: How to use the CL package | 130 | * Usage:: How to use the CL package. |
| 145 | * Organization:: The package's five component files | 131 | * Organization:: The package's five component files. |
| 146 | * Installation:: Compiling and installing CL | 132 | * Naming Conventions:: Notes on CL function names. |
| 147 | * Naming Conventions:: Notes on CL function names | ||
| 148 | @end menu | 133 | @end menu |
| 149 | 134 | ||
| 150 | @node Usage | 135 | @node Usage |
| 151 | @section Usage | 136 | @section Usage |
| 152 | 137 | ||
| 153 | @noindent | 138 | @noindent |
| 154 | Lisp code that uses features from the @dfn{CL} package should | 139 | The @code{CL} package is distributed with Emacs, so there is no need |
| 155 | include at the beginning: | 140 | to install any additional files in order to start using it. Lisp code |
| 141 | that uses features from the @code{CL} package should simply include at | ||
| 142 | the beginning: | ||
| 156 | 143 | ||
| 157 | @example | 144 | @example |
| 158 | (require 'cl) | 145 | (require 'cl-lib) |
| 159 | @end example | 146 | @end example |
| 160 | 147 | ||
| 161 | @noindent | 148 | @noindent |
| 162 | It is safe to arrange to load @dfn{CL} at all times, e.g., | 149 | You may wish to add such a statement to your init file, if you |
| 163 | in your @file{.emacs} file. But it's a good idea, for portability, | 150 | make frequent use of CL features. |
| 164 | to @code{(require 'cl)} in your code even if you do this. | ||
| 165 | 151 | ||
| 166 | @node Organization | 152 | @node Organization |
| 167 | @section Organization | 153 | @section Organization |
| 168 | 154 | ||
| 169 | @noindent | 155 | @noindent |
| 170 | The Common Lisp package is organized into four files: | 156 | The Common Lisp package is organized into four main files: |
| 171 | 157 | ||
| 172 | @table @file | 158 | @table @file |
| 173 | @item cl.el | 159 | @item cl-lib.el |
| 174 | This is the ``main'' file, which contains basic functions | 160 | This is the main file, which contains basic functions |
| 175 | and information about the package. This file is relatively | 161 | and information about the package. This file is relatively compact. |
| 176 | compact---about 700 lines. | ||
| 177 | 162 | ||
| 178 | @item cl-extra.el | 163 | @item cl-extra.el |
| 179 | This file contains the larger, more complex or unusual functions. | 164 | This file contains the larger, more complex or unusual functions. |
| 180 | It is kept separate so that packages which only want to use Common | 165 | It is kept separate so that packages which only want to use Common |
| 181 | Lisp fundamentals like the @code{cadr} function won't need to pay | 166 | Lisp fundamentals like the @code{cl-incf} function won't need to pay |
| 182 | the overhead of loading the more advanced functions. | 167 | the overhead of loading the more advanced functions. |
| 183 | 168 | ||
| 184 | @item cl-seq.el | 169 | @item cl-seq.el |
| 185 | This file contains most of the advanced functions for operating | 170 | This file contains most of the advanced functions for operating |
| 186 | on sequences or lists, such as @code{delete-if} and @code{assoc*}. | 171 | on sequences or lists, such as @code{cl-delete-if} and @code{cl-assoc}. |
| 187 | 172 | ||
| 188 | @item cl-macs.el | 173 | @item cl-macs.el |
| 189 | This file contains the features of the packages which are macros | 174 | This file contains the features that are macros instead of functions. |
| 190 | instead of functions. Macros expand when the caller is compiled, | 175 | Macros expand when the caller is compiled, not when it is run, so the |
| 191 | not when it is run, so the macros generally only need to be | 176 | macros generally only need to be present when the byte-compiler is |
| 192 | present when the byte-compiler is running (or when the macros are | 177 | running (or when the macros are used in uncompiled code). Most of the |
| 193 | used in uncompiled code such as a @file{.emacs} file). Most of | 178 | macros of this package are isolated in @file{cl-macs.el} so that they |
| 194 | the macros of this package are isolated in @file{cl-macs.el} so | 179 | won't take up memory unless you are compiling. |
| 195 | that they won't take up memory unless you are compiling. | ||
| 196 | @end table | 180 | @end table |
| 197 | 181 | ||
| 198 | The file @file{cl.el} includes all necessary @code{autoload} | 182 | The file @file{cl-lib.el} includes all necessary @code{autoload} |
| 199 | commands for the functions and macros in the other three files. | 183 | commands for the functions and macros in the other three files. |
| 200 | All you have to do is @code{(require 'cl)}, and @file{cl.el} | 184 | All you have to do is @code{(require 'cl-lib)}, and @file{cl-lib.el} |
| 201 | will take care of pulling in the other files when they are | 185 | will take care of pulling in the other files when they are |
| 202 | needed. | 186 | needed. |
| 203 | 187 | ||
| 204 | There is another file, @file{cl-compat.el}, which defines some | 188 | There is another file, @file{cl.el}, which was the main entry point |
| 205 | routines from the older @file{cl.el} package that are not otherwise | 189 | to the CL package prior to Emacs 24.3. Nowadays, it is replaced |
| 190 | by @file{cl-lib.el}. The two provide the same features, but use | ||
| 191 | different function names (in fact, @file{cl.el} just defines aliases | ||
| 192 | to the @file{cl-lib.el} definitions). In particular, the old @file{cl.el} | ||
| 193 | does not use a clean namespace. For this reason, Emacs has a policy | ||
| 194 | that packages distributed with Emacs must not load @code{cl} at run time. | ||
| 195 | (It is ok for them to load @code{cl} at @emph{compile} time, with | ||
| 196 | @code{eval-when-compile}, and use the macros it provides.) There is | ||
| 197 | no such restriction on the use of @code{cl-lib}. New code should use | ||
| 198 | @code{cl-lib} rather than @code{cl}. @xref{Naming Conventions}. | ||
| 199 | |||
| 200 | There is one more file, @file{cl-compat.el}, which defines some | ||
| 201 | routines from the older CL package that are not otherwise | ||
| 206 | present in the new package. This includes internal routines | 202 | present in the new package. This includes internal routines |
| 207 | like @code{setelt} and @code{zip-lists}, deprecated features | 203 | like @code{setelt} and @code{zip-lists}, deprecated features |
| 208 | like @code{defkeyword}, and an emulation of the old-style | 204 | like @code{defkeyword}, and an emulation of the old-style |
| 209 | multiple-values feature. This file is obsolete and should not be used | 205 | multiple-values feature. This file is obsolete and should not be used |
| 210 | in new code. @xref{Old CL Compatibility}. | 206 | in new code. @xref{Old CL Compatibility}. |
| 211 | 207 | ||
| 212 | @node Installation | ||
| 213 | @section Installation | ||
| 214 | |||
| 215 | @noindent | ||
| 216 | The @dfn{CL} package is distributed with Emacs, so there is no need | ||
| 217 | to install anything. | ||
| 218 | |||
| 219 | If you do need to install it, just put the byte-compiled files | ||
| 220 | @file{cl.elc}, @file{cl-extra.elc}, @file{cl-seq.elc}, | ||
| 221 | @file{cl-macs.elc}, and (if necessary) @file{cl-compat.elc} into a | ||
| 222 | directory on your @code{load-path}. Also, format the @file{cl.texi} | ||
| 223 | file and put the resulting Info files into a directory in your | ||
| 224 | @code{Info-directory-list}. | ||
| 225 | |||
| 226 | @node Naming Conventions | 208 | @node Naming Conventions |
| 227 | @section Naming Conventions | 209 | @section Naming Conventions |
| 228 | 210 | ||
| 229 | @noindent | 211 | @noindent |
| 230 | Except where noted, all functions defined by this package have the | 212 | Except where noted, all functions defined by this package have the |
| 231 | same names and calling conventions as their Common Lisp counterparts. | 213 | same calling conventions as their Common Lisp counterparts, and |
| 232 | 214 | names that are those of Common Lisp plus a @samp{cl-} prefix. | |
| 233 | Following is a complete list of functions whose names were changed | ||
| 234 | from Common Lisp, usually to avoid conflicts with Emacs. In each | ||
| 235 | case, a @samp{*} has been appended to the Common Lisp name to obtain | ||
| 236 | the Emacs name: | ||
| 237 | |||
| 238 | @example | ||
| 239 | defun* defsubst* defmacro* function* | ||
| 240 | member* assoc* rassoc* get* | ||
| 241 | remove* delete* mapcar* sort* | ||
| 242 | floor* ceiling* truncate* round* | ||
| 243 | mod* rem* random* | ||
| 244 | @end example | ||
| 245 | 215 | ||
| 246 | Internal function and variable names in the package are prefixed | 216 | Internal function and variable names in the package are prefixed |
| 247 | by @code{cl-}. Here is a complete list of functions @emph{not} | 217 | by @code{cl--}. Here is a complete list of functions prefixed by |
| 248 | prefixed by @code{cl-} which were not taken from Common Lisp: | 218 | @code{cl-} that were not taken from Common Lisp: |
| 249 | 219 | ||
| 220 | @c FIXME lexical-let lexical-let* | ||
| 250 | @example | 221 | @example |
| 251 | floatp-safe lexical-let lexical-let* | 222 | cl-callf cl-callf2 cl-defsubst |
| 252 | callf callf2 letf letf* | 223 | cl-floatp-safe cl-letf cl-letf* |
| 253 | defsubst* | ||
| 254 | @end example | 224 | @end example |
| 255 | 225 | ||
| 256 | The following simple functions and macros are defined in @file{cl.el}; | 226 | The following simple functions and macros are defined in @file{cl-lib.el}; |
| 257 | they do not cause other components like @file{cl-extra} to be loaded. | 227 | they do not cause other components like @file{cl-extra} to be loaded. |
| 258 | 228 | ||
| 259 | @example | 229 | @example |
| 260 | floatp-safe endp | 230 | cl-floatp-safe cl-endp |
| 261 | evenp oddp plusp minusp | 231 | cl-evenp cl-oddp cl-plusp cl-minusp |
| 262 | caaar .. cddddr | 232 | cl-caaar .. cl-cddddr |
| 263 | list* ldiff rest first .. tenth | 233 | cl-list* cl-ldiff cl-rest cl-first .. cl-tenth |
| 264 | copy-list subst mapcar* [2] | 234 | cl-copy-list cl-subst cl-mapcar [2] |
| 265 | adjoin [3] acons pairlis pop [4] | 235 | cl-adjoin [3] cl-acons cl-pairlis |
| 266 | push [4] pushnew [3,4] incf [4] decf [4] | 236 | cl-pushnew [3,4] cl-incf [4] cl-decf [4] |
| 267 | proclaim declaim | 237 | cl-proclaim cl-declaim |
| 268 | @end example | 238 | @end example |
| 269 | 239 | ||
| 270 | @noindent | 240 | @noindent |
| @@ -281,13 +251,13 @@ and @code{:key} is not used. | |||
| 281 | @chapter Program Structure | 251 | @chapter Program Structure |
| 282 | 252 | ||
| 283 | @noindent | 253 | @noindent |
| 284 | This section describes features of the @dfn{CL} package which have to | 254 | This section describes features of the @code{CL} package that have to |
| 285 | do with programs as a whole: advanced argument lists for functions, | 255 | do with programs as a whole: advanced argument lists for functions, |
| 286 | and the @code{eval-when} construct. | 256 | and the @code{cl-eval-when} construct. |
| 287 | 257 | ||
| 288 | @menu | 258 | @menu |
| 289 | * Argument Lists:: @code{&key}, @code{&aux}, @code{defun*}, @code{defmacro*}. | 259 | * Argument Lists:: @code{&key}, @code{&aux}, @code{cl-defun}, @code{cl-defmacro}. |
| 290 | * Time of Evaluation:: The @code{eval-when} construct. | 260 | * Time of Evaluation:: The @code{cl-eval-when} construct. |
| 291 | @end menu | 261 | @end menu |
| 292 | 262 | ||
| 293 | @iftex | 263 | @iftex |
| @@ -309,26 +279,26 @@ this package to implement Common Lisp argument lists seamlessly. | |||
| 309 | Instead, this package defines alternates for several Lisp forms | 279 | Instead, this package defines alternates for several Lisp forms |
| 310 | which you must use if you need Common Lisp argument lists. | 280 | which you must use if you need Common Lisp argument lists. |
| 311 | 281 | ||
| 312 | @defspec defun* name arglist body... | 282 | @defspec cl-defun name arglist body... |
| 313 | This form is identical to the regular @code{defun} form, except | 283 | This form is identical to the regular @code{defun} form, except |
| 314 | that @var{arglist} is allowed to be a full Common Lisp argument | 284 | that @var{arglist} is allowed to be a full Common Lisp argument |
| 315 | list. Also, the function body is enclosed in an implicit block | 285 | list. Also, the function body is enclosed in an implicit block |
| 316 | called @var{name}; @pxref{Blocks and Exits}. | 286 | called @var{name}; @pxref{Blocks and Exits}. |
| 317 | @end defspec | 287 | @end defspec |
| 318 | 288 | ||
| 319 | @defspec defsubst* name arglist body... | 289 | @defspec cl-defsubst name arglist body... |
| 320 | This is just like @code{defun*}, except that the function that | 290 | This is just like @code{cl-defun}, except that the function that |
| 321 | is defined is automatically proclaimed @code{inline}, i.e., | 291 | is defined is automatically proclaimed @code{inline}, i.e., |
| 322 | calls to it may be expanded into in-line code by the byte compiler. | 292 | calls to it may be expanded into in-line code by the byte compiler. |
| 323 | This is analogous to the @code{defsubst} form; | 293 | This is analogous to the @code{defsubst} form; |
| 324 | @code{defsubst*} uses a different method (compiler macros) which | 294 | @code{cl-defsubst} uses a different method (compiler macros) which |
| 325 | works in all versions of Emacs, and also generates somewhat more | 295 | works in all versions of Emacs, and also generates somewhat more |
| 326 | efficient inline expansions. In particular, @code{defsubst*} | 296 | efficient inline expansions. In particular, @code{cl-defsubst} |
| 327 | arranges for the processing of keyword arguments, default values, | 297 | arranges for the processing of keyword arguments, default values, |
| 328 | etc., to be done at compile-time whenever possible. | 298 | etc., to be done at compile-time whenever possible. |
| 329 | @end defspec | 299 | @end defspec |
| 330 | 300 | ||
| 331 | @defspec defmacro* name arglist body... | 301 | @defspec cl-defmacro name arglist body... |
| 332 | This is identical to the regular @code{defmacro} form, | 302 | This is identical to the regular @code{defmacro} form, |
| 333 | except that @var{arglist} is allowed to be a full Common Lisp | 303 | except that @var{arglist} is allowed to be a full Common Lisp |
| 334 | argument list. The @code{&environment} keyword is supported as | 304 | argument list. The @code{&environment} keyword is supported as |
| @@ -339,19 +309,19 @@ The macro expander body is enclosed in an implicit block called | |||
| 339 | @var{name}. | 309 | @var{name}. |
| 340 | @end defspec | 310 | @end defspec |
| 341 | 311 | ||
| 342 | @defspec function* symbol-or-lambda | 312 | @defspec cl-function symbol-or-lambda |
| 343 | This is identical to the regular @code{function} form, | 313 | This is identical to the regular @code{function} form, |
| 344 | except that if the argument is a @code{lambda} form then that | 314 | except that if the argument is a @code{lambda} form then that |
| 345 | form may use a full Common Lisp argument list. | 315 | form may use a full Common Lisp argument list. |
| 346 | @end defspec | 316 | @end defspec |
| 347 | 317 | ||
| 348 | Also, all forms (such as @code{defsetf} and @code{flet}) defined | 318 | Also, all forms (such as @code{cl-flet} and @code{cl-labels}) defined |
| 349 | in this package that include @var{arglist}s in their syntax allow | 319 | in this package that include @var{arglist}s in their syntax allow |
| 350 | full Common Lisp argument lists. | 320 | full Common Lisp argument lists. |
| 351 | 321 | ||
| 352 | Note that it is @emph{not} necessary to use @code{defun*} in | 322 | Note that it is @emph{not} necessary to use @code{cl-defun} in |
| 353 | order to have access to most @dfn{CL} features in your function. | 323 | order to have access to most @code{CL} features in your function. |
| 354 | These features are always present; @code{defun*}'s only | 324 | These features are always present; @code{cl-defun}'s only |
| 355 | difference from @code{defun} is its more flexible argument | 325 | difference from @code{defun} is its more flexible argument |
| 356 | lists and its implicit block. | 326 | lists and its implicit block. |
| 357 | 327 | ||
| @@ -401,7 +371,7 @@ are optional arguments which are specified by name rather than | |||
| 401 | positionally in the argument list. For example, | 371 | positionally in the argument list. For example, |
| 402 | 372 | ||
| 403 | @example | 373 | @example |
| 404 | (defun* foo (a &optional b &key c d (e 17))) | 374 | (cl-defun foo (a &optional b &key c d (e 17))) |
| 405 | @end example | 375 | @end example |
| 406 | 376 | ||
| 407 | @noindent | 377 | @noindent |
| @@ -427,7 +397,7 @@ You can also explicitly specify the keyword argument; it need not be | |||
| 427 | simply the variable name prefixed with a colon. For example, | 397 | simply the variable name prefixed with a colon. For example, |
| 428 | 398 | ||
| 429 | @example | 399 | @example |
| 430 | (defun* bar (&key (a 1) ((baz b) 4))) | 400 | (cl-defun bar (&key (a 1) ((baz b) 4))) |
| 431 | @end example | 401 | @end example |
| 432 | 402 | ||
| 433 | @noindent | 403 | @noindent |
| @@ -453,16 +423,16 @@ the ``rest'' argument is bound to the keyword list as it appears | |||
| 453 | in the call. For example: | 423 | in the call. For example: |
| 454 | 424 | ||
| 455 | @smallexample | 425 | @smallexample |
| 456 | (defun* find-thing (thing &rest rest &key need &allow-other-keys) | 426 | (cl-defun find-thing (thing &rest rest &key need &allow-other-keys) |
| 457 | (or (apply 'member* thing thing-list :allow-other-keys t rest) | 427 | (or (apply 'cl-member thing thing-list :allow-other-keys t rest) |
| 458 | (if need (error "Thing not found")))) | 428 | (if need (error "Thing not found")))) |
| 459 | @end smallexample | 429 | @end smallexample |
| 460 | 430 | ||
| 461 | @noindent | 431 | @noindent |
| 462 | This function takes a @code{:need} keyword argument, but also | 432 | This function takes a @code{:need} keyword argument, but also |
| 463 | accepts other keyword arguments which are passed on to the | 433 | accepts other keyword arguments which are passed on to the |
| 464 | @code{member*} function. @code{allow-other-keys} is used to | 434 | @code{cl-member} function. @code{allow-other-keys} is used to |
| 465 | keep both @code{find-thing} and @code{member*} from complaining | 435 | keep both @code{find-thing} and @code{cl-member} from complaining |
| 466 | about each others' keywords in the arguments. | 436 | about each others' keywords in the arguments. |
| 467 | 437 | ||
| 468 | The fifth section of the argument list consists of @dfn{auxiliary | 438 | The fifth section of the argument list consists of @dfn{auxiliary |
| @@ -473,17 +443,17 @@ difference between the following two functions, except for a | |||
| 473 | matter of stylistic taste: | 443 | matter of stylistic taste: |
| 474 | 444 | ||
| 475 | @example | 445 | @example |
| 476 | (defun* foo (a b &aux (c (+ a b)) d) | 446 | (cl-defun foo (a b &aux (c (+ a b)) d) |
| 477 | @var{body}) | 447 | @var{body}) |
| 478 | 448 | ||
| 479 | (defun* foo (a b) | 449 | (cl-defun foo (a b) |
| 480 | (let ((c (+ a b)) d) | 450 | (let ((c (+ a b)) d) |
| 481 | @var{body})) | 451 | @var{body})) |
| 482 | @end example | 452 | @end example |
| 483 | 453 | ||
| 484 | Argument lists support @dfn{destructuring}. In Common Lisp, | 454 | Argument lists support @dfn{destructuring}. In Common Lisp, |
| 485 | destructuring is only allowed with @code{defmacro}; this package | 455 | destructuring is only allowed with @code{defmacro}; this package |
| 486 | allows it with @code{defun*} and other argument lists as well. | 456 | allows it with @code{cl-defun} and other argument lists as well. |
| 487 | In destructuring, any argument variable (@var{var} in the above | 457 | In destructuring, any argument variable (@var{var} in the above |
| 488 | diagram) can be replaced by a list of variables, or more generally, | 458 | diagram) can be replaced by a list of variables, or more generally, |
| 489 | a recursive argument list. The corresponding argument value must | 459 | a recursive argument list. The corresponding argument value must |
| @@ -491,7 +461,7 @@ be a list whose elements match this recursive argument list. | |||
| 491 | For example: | 461 | For example: |
| 492 | 462 | ||
| 493 | @example | 463 | @example |
| 494 | (defmacro* dolist ((var listform &optional resultform) | 464 | (cl-defmacro dolist ((var listform &optional resultform) |
| 495 | &rest body) | 465 | &rest body) |
| 496 | ...) | 466 | ...) |
| 497 | @end example | 467 | @end example |
| @@ -532,21 +502,21 @@ For example, the compiler effectively evaluates @code{defmacro} forms | |||
| 532 | at compile-time so that later parts of the file can refer to the | 502 | at compile-time so that later parts of the file can refer to the |
| 533 | macros that are defined. | 503 | macros that are defined. |
| 534 | 504 | ||
| 535 | @defspec eval-when (situations...) forms... | 505 | @defspec cl-eval-when (situations...) forms... |
| 536 | This form controls when the body @var{forms} are evaluated. | 506 | This form controls when the body @var{forms} are evaluated. |
| 537 | The @var{situations} list may contain any set of the symbols | 507 | The @var{situations} list may contain any set of the symbols |
| 538 | @code{compile}, @code{load}, and @code{eval} (or their long-winded | 508 | @code{compile}, @code{load}, and @code{eval} (or their long-winded |
| 539 | ANSI equivalents, @code{:compile-toplevel}, @code{:load-toplevel}, | 509 | ANSI equivalents, @code{:compile-toplevel}, @code{:load-toplevel}, |
| 540 | and @code{:execute}). | 510 | and @code{:execute}). |
| 541 | 511 | ||
| 542 | The @code{eval-when} form is handled differently depending on | 512 | The @code{cl-eval-when} form is handled differently depending on |
| 543 | whether or not it is being compiled as a top-level form. | 513 | whether or not it is being compiled as a top-level form. |
| 544 | Specifically, it gets special treatment if it is being compiled | 514 | Specifically, it gets special treatment if it is being compiled |
| 545 | by a command such as @code{byte-compile-file} which compiles files | 515 | by a command such as @code{byte-compile-file} which compiles files |
| 546 | or buffers of code, and it appears either literally at the | 516 | or buffers of code, and it appears either literally at the |
| 547 | top level of the file or inside a top-level @code{progn}. | 517 | top level of the file or inside a top-level @code{progn}. |
| 548 | 518 | ||
| 549 | For compiled top-level @code{eval-when}s, the body @var{forms} are | 519 | For compiled top-level @code{cl-eval-when}s, the body @var{forms} are |
| 550 | executed at compile-time if @code{compile} is in the @var{situations} | 520 | executed at compile-time if @code{compile} is in the @var{situations} |
| 551 | list, and the @var{forms} are written out to the file (to be executed | 521 | list, and the @var{forms} are written out to the file (to be executed |
| 552 | at load-time) if @code{load} is in the @var{situations} list. | 522 | at load-time) if @code{load} is in the @var{situations} list. |
| @@ -554,11 +524,11 @@ at load-time) if @code{load} is in the @var{situations} list. | |||
| 554 | For non-compiled-top-level forms, only the @code{eval} situation is | 524 | For non-compiled-top-level forms, only the @code{eval} situation is |
| 555 | relevant. (This includes forms executed by the interpreter, forms | 525 | relevant. (This includes forms executed by the interpreter, forms |
| 556 | compiled with @code{byte-compile} rather than @code{byte-compile-file}, | 526 | compiled with @code{byte-compile} rather than @code{byte-compile-file}, |
| 557 | and non-top-level forms.) The @code{eval-when} acts like a | 527 | and non-top-level forms.) The @code{cl-eval-when} acts like a |
| 558 | @code{progn} if @code{eval} is specified, and like @code{nil} | 528 | @code{progn} if @code{eval} is specified, and like @code{nil} |
| 559 | (ignoring the body @var{forms}) if not. | 529 | (ignoring the body @var{forms}) if not. |
| 560 | 530 | ||
| 561 | The rules become more subtle when @code{eval-when}s are nested; | 531 | The rules become more subtle when @code{cl-eval-when}s are nested; |
| 562 | consult Steele (second edition) for the gruesome details (and | 532 | consult Steele (second edition) for the gruesome details (and |
| 563 | some gruesome examples). | 533 | some gruesome examples). |
| 564 | 534 | ||
| @@ -566,13 +536,13 @@ Some simple examples: | |||
| 566 | 536 | ||
| 567 | @example | 537 | @example |
| 568 | ;; Top-level forms in foo.el: | 538 | ;; Top-level forms in foo.el: |
| 569 | (eval-when (compile) (setq foo1 'bar)) | 539 | (cl-eval-when (compile) (setq foo1 'bar)) |
| 570 | (eval-when (load) (setq foo2 'bar)) | 540 | (cl-eval-when (load) (setq foo2 'bar)) |
| 571 | (eval-when (compile load) (setq foo3 'bar)) | 541 | (cl-eval-when (compile load) (setq foo3 'bar)) |
| 572 | (eval-when (eval) (setq foo4 'bar)) | 542 | (cl-eval-when (eval) (setq foo4 'bar)) |
| 573 | (eval-when (eval compile) (setq foo5 'bar)) | 543 | (cl-eval-when (eval compile) (setq foo5 'bar)) |
| 574 | (eval-when (eval load) (setq foo6 'bar)) | 544 | (cl-eval-when (eval load) (setq foo6 'bar)) |
| 575 | (eval-when (eval compile load) (setq foo7 'bar)) | 545 | (cl-eval-when (eval compile load) (setq foo7 'bar)) |
| 576 | @end example | 546 | @end example |
| 577 | 547 | ||
| 578 | When @file{foo.el} is compiled, these variables will be set during | 548 | When @file{foo.el} is compiled, these variables will be set during |
| @@ -595,18 +565,18 @@ be set: | |||
| 595 | foo4 foo5 foo6 foo7 ; `eval' | 565 | foo4 foo5 foo6 foo7 ; `eval' |
| 596 | @end example | 566 | @end example |
| 597 | 567 | ||
| 598 | If these seven @code{eval-when}s had been, say, inside a @code{defun}, | 568 | If these seven @code{cl-eval-when}s had been, say, inside a @code{defun}, |
| 599 | then the first three would have been equivalent to @code{nil} and the | 569 | then the first three would have been equivalent to @code{nil} and the |
| 600 | last four would have been equivalent to the corresponding @code{setq}s. | 570 | last four would have been equivalent to the corresponding @code{setq}s. |
| 601 | 571 | ||
| 602 | Note that @code{(eval-when (load eval) @dots{})} is equivalent | 572 | Note that @code{(cl-eval-when (load eval) @dots{})} is equivalent |
| 603 | to @code{(progn @dots{})} in all contexts. The compiler treats | 573 | to @code{(progn @dots{})} in all contexts. The compiler treats |
| 604 | certain top-level forms, like @code{defmacro} (sort-of) and | 574 | certain top-level forms, like @code{defmacro} (sort-of) and |
| 605 | @code{require}, as if they were wrapped in @code{(eval-when | 575 | @code{require}, as if they were wrapped in @code{(eval-when |
| 606 | (compile load eval) @dots{})}. | 576 | (compile load eval) @dots{})}. |
| 607 | @end defspec | 577 | @end defspec |
| 608 | 578 | ||
| 609 | Emacs includes two special forms related to @code{eval-when}. | 579 | Emacs includes two special forms related to @code{cl-eval-when}. |
| 610 | One of these, @code{eval-when-compile}, is not quite equivalent to | 580 | One of these, @code{eval-when-compile}, is not quite equivalent to |
| 611 | any @code{eval-when} construct and is described below. | 581 | any @code{eval-when} construct and is described below. |
| 612 | 582 | ||
| @@ -625,7 +595,7 @@ or other reasons. | |||
| 625 | This form is similar to the @samp{#.} syntax of true Common Lisp. | 595 | This form is similar to the @samp{#.} syntax of true Common Lisp. |
| 626 | @end defspec | 596 | @end defspec |
| 627 | 597 | ||
| 628 | @defspec load-time-value form | 598 | @defspec cl-load-time-value form |
| 629 | The @var{form} is evaluated at load-time; at execution time, | 599 | The @var{form} is evaluated at load-time; at execution time, |
| 630 | this form acts like a quoted constant of the resulting value. | 600 | this form acts like a quoted constant of the resulting value. |
| 631 | 601 | ||
| @@ -633,12 +603,12 @@ Early Common Lisp had a @samp{#,} syntax that was similar to | |||
| 633 | this, but ANSI Common Lisp replaced it with @code{load-time-value} | 603 | this, but ANSI Common Lisp replaced it with @code{load-time-value} |
| 634 | and gave it more well-defined semantics. | 604 | and gave it more well-defined semantics. |
| 635 | 605 | ||
| 636 | In a compiled file, @code{load-time-value} arranges for @var{form} | 606 | In a compiled file, @code{cl-load-time-value} arranges for @var{form} |
| 637 | to be evaluated when the @file{.elc} file is loaded and then used | 607 | to be evaluated when the @file{.elc} file is loaded and then used |
| 638 | as if it were a quoted constant. In code compiled by | 608 | as if it were a quoted constant. In code compiled by |
| 639 | @code{byte-compile} rather than @code{byte-compile-file}, the | 609 | @code{byte-compile} rather than @code{byte-compile-file}, the |
| 640 | effect is identical to @code{eval-when-compile}. In uncompiled | 610 | effect is identical to @code{eval-when-compile}. In uncompiled |
| 641 | code, both @code{eval-when-compile} and @code{load-time-value} | 611 | code, both @code{eval-when-compile} and @code{cl-load-time-value} |
| 642 | act exactly like @code{progn}. | 612 | act exactly like @code{progn}. |
| 643 | 613 | ||
| 644 | @example | 614 | @example |
| @@ -649,7 +619,7 @@ act exactly like @code{progn}. | |||
| 649 | (eval-when-compile (current-time-string)) | 619 | (eval-when-compile (current-time-string)) |
| 650 | ;; or '#.(current-time-string) in real Common Lisp | 620 | ;; or '#.(current-time-string) in real Common Lisp |
| 651 | ", and loaded on: " | 621 | ", and loaded on: " |
| 652 | (load-time-value (current-time-string)))) | 622 | (cl-load-time-value (current-time-string)))) |
| 653 | @end example | 623 | @end example |
| 654 | 624 | ||
| 655 | @noindent | 625 | @noindent |
| @@ -676,21 +646,21 @@ This section describes functions for testing whether various | |||
| 676 | facts are true or false. | 646 | facts are true or false. |
| 677 | 647 | ||
| 678 | @menu | 648 | @menu |
| 679 | * Type Predicates:: @code{typep}, @code{deftype}, and @code{coerce} | 649 | * Type Predicates:: @code{cl-typep}, @code{cl-deftype}, and @code{cl-coerce}. |
| 680 | * Equality Predicates:: @code{equalp} | 650 | * Equality Predicates:: @code{cl-equalp}. |
| 681 | @end menu | 651 | @end menu |
| 682 | 652 | ||
| 683 | @node Type Predicates | 653 | @node Type Predicates |
| 684 | @section Type Predicates | 654 | @section Type Predicates |
| 685 | 655 | ||
| 686 | @noindent | 656 | @noindent |
| 687 | The @dfn{CL} package defines a version of the Common Lisp @code{typep} | 657 | The @code{CL} package defines a version of the Common Lisp @code{typep} |
| 688 | predicate. | 658 | predicate. |
| 689 | 659 | ||
| 690 | @defun typep object type | 660 | @defun cl-typep object type |
| 691 | Check if @var{object} is of type @var{type}, where @var{type} is a | 661 | Check if @var{object} is of type @var{type}, where @var{type} is a |
| 692 | (quoted) type name of the sort used by Common Lisp. For example, | 662 | (quoted) type name of the sort used by Common Lisp. For example, |
| 693 | @code{(typep foo 'integer)} is equivalent to @code{(integerp foo)}. | 663 | @code{(cl-typep foo 'integer)} is equivalent to @code{(integerp foo)}. |
| 694 | @end defun | 664 | @end defun |
| 695 | 665 | ||
| 696 | The @var{type} argument to the above function is either a symbol | 666 | The @var{type} argument to the above function is either a symbol |
| @@ -705,18 +675,18 @@ than @samp{-p} are used when appropriate.) | |||
| 705 | 675 | ||
| 706 | @item | 676 | @item |
| 707 | The type symbol @code{t} stands for the union of all types. | 677 | The type symbol @code{t} stands for the union of all types. |
| 708 | @code{(typep @var{object} t)} is always true. Likewise, the | 678 | @code{(cl-typep @var{object} t)} is always true. Likewise, the |
| 709 | type symbol @code{nil} stands for nothing at all, and | 679 | type symbol @code{nil} stands for nothing at all, and |
| 710 | @code{(typep @var{object} nil)} is always false. | 680 | @code{(cl-typep @var{object} nil)} is always false. |
| 711 | 681 | ||
| 712 | @item | 682 | @item |
| 713 | The type symbol @code{null} represents the symbol @code{nil}. | 683 | The type symbol @code{null} represents the symbol @code{nil}. |
| 714 | Thus @code{(typep @var{object} 'null)} is equivalent to | 684 | Thus @code{(cl-typep @var{object} 'null)} is equivalent to |
| 715 | @code{(null @var{object})}. | 685 | @code{(null @var{object})}. |
| 716 | 686 | ||
| 717 | @item | 687 | @item |
| 718 | The type symbol @code{atom} represents all objects that are not cons | 688 | The type symbol @code{atom} represents all objects that are not cons |
| 719 | cells. Thus @code{(typep @var{object} 'atom)} is equivalent to | 689 | cells. Thus @code{(cl-typep @var{object} 'atom)} is equivalent to |
| 720 | @code{(atom @var{object})}. | 690 | @code{(atom @var{object})}. |
| 721 | 691 | ||
| 722 | @item | 692 | @item |
| @@ -728,7 +698,7 @@ The type symbols @code{character} and @code{string-char} match | |||
| 728 | integers in the range from 0 to 255. | 698 | integers in the range from 0 to 255. |
| 729 | 699 | ||
| 730 | @item | 700 | @item |
| 731 | The type symbol @code{float} uses the @code{floatp-safe} predicate | 701 | The type symbol @code{float} uses the @code{cl-floatp-safe} predicate |
| 732 | defined by this package rather than @code{floatp}, so it will work | 702 | defined by this package rather than @code{floatp}, so it will work |
| 733 | correctly even in Emacs versions without floating-point support. | 703 | correctly even in Emacs versions without floating-point support. |
| 734 | 704 | ||
| @@ -750,7 +720,7 @@ combinations of types. For example, @code{(or integer (float 0 *))} | |||
| 750 | represents all objects that are integers or non-negative floats. | 720 | represents all objects that are integers or non-negative floats. |
| 751 | 721 | ||
| 752 | @item | 722 | @item |
| 753 | Lists beginning with @code{member} or @code{member*} represent | 723 | Lists beginning with @code{member} or @code{cl-member} represent |
| 754 | objects @code{eql} to any of the following values. For example, | 724 | objects @code{eql} to any of the following values. For example, |
| 755 | @code{(member 1 2 3 4)} is equivalent to @code{(integer 1 4)}, | 725 | @code{(member 1 2 3 4)} is equivalent to @code{(integer 1 4)}, |
| 756 | and @code{(member nil)} is equivalent to @code{null}. | 726 | and @code{(member nil)} is equivalent to @code{null}. |
| @@ -762,9 +732,9 @@ with that object as an argument. | |||
| 762 | @end itemize | 732 | @end itemize |
| 763 | 733 | ||
| 764 | The following function and macro (not technically predicates) are | 734 | The following function and macro (not technically predicates) are |
| 765 | related to @code{typep}. | 735 | related to @code{cl-typep}. |
| 766 | 736 | ||
| 767 | @defun coerce object type | 737 | @defun cl-coerce object type |
| 768 | This function attempts to convert @var{object} to the specified | 738 | This function attempts to convert @var{object} to the specified |
| 769 | @var{type}. If @var{object} is already of that type as determined by | 739 | @var{type}. If @var{object} is already of that type as determined by |
| 770 | @code{typep}, it is simply returned. Otherwise, certain types of | 740 | @code{typep}, it is simply returned. Otherwise, certain types of |
| @@ -774,28 +744,28 @@ converted to that type if possible. If @var{type} is | |||
| 774 | @code{character}, then strings of length one and symbols with | 744 | @code{character}, then strings of length one and symbols with |
| 775 | one-character names can be coerced. If @var{type} is @code{float}, | 745 | one-character names can be coerced. If @var{type} is @code{float}, |
| 776 | then integers can be coerced in versions of Emacs that support | 746 | then integers can be coerced in versions of Emacs that support |
| 777 | floats. In all other circumstances, @code{coerce} signals an | 747 | floats. In all other circumstances, @code{cl-coerce} signals an |
| 778 | error. | 748 | error. |
| 779 | @end defun | 749 | @end defun |
| 780 | 750 | ||
| 781 | @defspec deftype name arglist forms... | 751 | @defspec cl-deftype name arglist forms... |
| 782 | This macro defines a new type called @var{name}. It is similar | 752 | This macro defines a new type called @var{name}. It is similar |
| 783 | to @code{defmacro} in many ways; when @var{name} is encountered | 753 | to @code{defmacro} in many ways; when @var{name} is encountered |
| 784 | as a type name, the body @var{forms} are evaluated and should | 754 | as a type name, the body @var{forms} are evaluated and should |
| 785 | return a type specifier that is equivalent to the type. The | 755 | return a type specifier that is equivalent to the type. The |
| 786 | @var{arglist} is a Common Lisp argument list of the sort accepted | 756 | @var{arglist} is a Common Lisp argument list of the sort accepted |
| 787 | by @code{defmacro*}. The type specifier @samp{(@var{name} @var{args}...)} | 757 | by @code{cl-defmacro}. The type specifier @samp{(@var{name} @var{args}...)} |
| 788 | is expanded by calling the expander with those arguments; the type | 758 | is expanded by calling the expander with those arguments; the type |
| 789 | symbol @samp{@var{name}} is expanded by calling the expander with | 759 | symbol @samp{@var{name}} is expanded by calling the expander with |
| 790 | no arguments. The @var{arglist} is processed the same as for | 760 | no arguments. The @var{arglist} is processed the same as for |
| 791 | @code{defmacro*} except that optional arguments without explicit | 761 | @code{cl-defmacro} except that optional arguments without explicit |
| 792 | defaults use @code{*} instead of @code{nil} as the ``default'' | 762 | defaults use @code{*} instead of @code{nil} as the ``default'' |
| 793 | default. Some examples: | 763 | default. Some examples: |
| 794 | 764 | ||
| 795 | @example | 765 | @example |
| 796 | (deftype null () '(satisfies null)) ; predefined | 766 | (cl-deftype null () '(satisfies null)) ; predefined |
| 797 | (deftype list () '(or null cons)) ; predefined | 767 | (cl-deftype list () '(or null cons)) ; predefined |
| 798 | (deftype unsigned-byte (&optional bits) | 768 | (cl-deftype unsigned-byte (&optional bits) |
| 799 | (list 'integer 0 (if (eq bits '*) bits (1- (lsh 1 bits))))) | 769 | (list 'integer 0 (if (eq bits '*) bits (1- (lsh 1 bits))))) |
| 800 | (unsigned-byte 8) @equiv{} (integer 0 255) | 770 | (unsigned-byte 8) @equiv{} (integer 0 255) |
| 801 | (unsigned-byte) @equiv{} (integer 0 *) | 771 | (unsigned-byte) @equiv{} (integer 0 *) |
| @@ -808,21 +778,21 @@ type specifier could be implemented if desired; this package does | |||
| 808 | not implement @code{unsigned-byte} by default. | 778 | not implement @code{unsigned-byte} by default. |
| 809 | @end defspec | 779 | @end defspec |
| 810 | 780 | ||
| 811 | The @code{typecase} and @code{check-type} macros also use type | 781 | The @code{cl-typecase} and @code{cl-check-type} macros also use type |
| 812 | names. @xref{Conditionals}. @xref{Assertions}. The @code{map}, | 782 | names. @xref{Conditionals}. @xref{Assertions}. The @code{cl-map}, |
| 813 | @code{concatenate}, and @code{merge} functions take type-name | 783 | @code{cl-concatenate}, and @code{cl-merge} functions take type-name |
| 814 | arguments to specify the type of sequence to return. @xref{Sequences}. | 784 | arguments to specify the type of sequence to return. @xref{Sequences}. |
| 815 | 785 | ||
| 816 | @node Equality Predicates | 786 | @node Equality Predicates |
| 817 | @section Equality Predicates | 787 | @section Equality Predicates |
| 818 | 788 | ||
| 819 | @noindent | 789 | @noindent |
| 820 | This package defines the Common Lisp predicate @code{equalp}. | 790 | This package defines the Common Lisp predicate @code{cl-equalp}. |
| 821 | 791 | ||
| 822 | @defun equalp a b | 792 | @defun cl-equalp a b |
| 823 | This function is a more flexible version of @code{equal}. In | 793 | This function is a more flexible version of @code{equal}. In |
| 824 | particular, it compares strings case-insensitively, and it compares | 794 | particular, it compares strings case-insensitively, and it compares |
| 825 | numbers without regard to type (so that @code{(equalp 3 3.0)} is | 795 | numbers without regard to type (so that @code{(cl-equalp 3 3.0)} is |
| 826 | true). Vectors and conses are compared recursively. All other | 796 | true). Vectors and conses are compared recursively. All other |
| 827 | objects are compared as if by @code{equal}. | 797 | objects are compared as if by @code{equal}. |
| 828 | 798 | ||
| @@ -831,15 +801,15 @@ respects. First, Common Lisp's @code{equalp} also compares | |||
| 831 | @emph{characters} case-insensitively, which would be impractical | 801 | @emph{characters} case-insensitively, which would be impractical |
| 832 | in this package since Emacs does not distinguish between integers | 802 | in this package since Emacs does not distinguish between integers |
| 833 | and characters. In keeping with the idea that strings are less | 803 | and characters. In keeping with the idea that strings are less |
| 834 | vector-like in Emacs Lisp, this package's @code{equalp} also will | 804 | vector-like in Emacs Lisp, this package's @code{cl-equalp} also will |
| 835 | not compare strings against vectors of integers. | 805 | not compare strings against vectors of integers. |
| 836 | @end defun | 806 | @end defun |
| 837 | 807 | ||
| 838 | Also note that the Common Lisp functions @code{member} and @code{assoc} | 808 | Also note that the Common Lisp functions @code{member} and @code{assoc} |
| 839 | use @code{eql} to compare elements, whereas Emacs Lisp follows the | 809 | use @code{eql} to compare elements, whereas Emacs Lisp follows the |
| 840 | MacLisp tradition and uses @code{equal} for these two functions. | 810 | MacLisp tradition and uses @code{equal} for these two functions. |
| 841 | In Emacs, use @code{member*} and @code{assoc*} to get functions | 811 | In Emacs, use @code{memq} (or @code{cl-member}) and @code{assq} (or |
| 842 | which use @code{eql} for comparisons. | 812 | @code{cl-assoc}) to get functions which use @code{eql} for comparisons. |
| 843 | 813 | ||
| 844 | @node Control Structure | 814 | @node Control Structure |
| 845 | @chapter Control Structure | 815 | @chapter Control Structure |
| @@ -847,28 +817,32 @@ which use @code{eql} for comparisons. | |||
| 847 | @noindent | 817 | @noindent |
| 848 | The features described in the following sections implement | 818 | The features described in the following sections implement |
| 849 | various advanced control structures, including the powerful | 819 | various advanced control structures, including the powerful |
| 820 | @c FIXME setf is now in gv.el, not cl. | ||
| 850 | @code{setf} facility and a number of looping and conditional | 821 | @code{setf} facility and a number of looping and conditional |
| 851 | constructs. | 822 | constructs. |
| 852 | 823 | ||
| 824 | @c FIXME setf, push are standard now. | ||
| 825 | @c lexical-let is obsolete; flet is not cl-flet. | ||
| 826 | @c values is not cl-values. | ||
| 853 | @menu | 827 | @menu |
| 854 | * Assignment:: The @code{psetq} form | 828 | * Assignment:: The @code{cl-psetq} form. |
| 855 | * Generalized Variables:: @code{setf}, @code{incf}, @code{push}, etc. | 829 | * Generalized Variables:: @code{setf}, @code{cl-incf}, @code{push}, etc. |
| 856 | * Variable Bindings:: @code{progv}, @code{lexical-let}, @code{flet}, @code{macrolet} | 830 | * Variable Bindings:: @code{cl-progv}, @code{lexical-let}, @code{flet}, @code{cl-macrolet}. |
| 857 | * Conditionals:: @code{case}, @code{typecase} | 831 | * Conditionals:: @code{cl-case}, @code{cl-typecase}. |
| 858 | * Blocks and Exits:: @code{block}, @code{return}, @code{return-from} | 832 | * Blocks and Exits:: @code{cl-block}, @code{cl-return}, @code{cl-return-from}. |
| 859 | * Iteration:: @code{do}, @code{dotimes}, @code{dolist}, @code{do-symbols} | 833 | * Iteration:: @code{cl-do}, @code{cl-dotimes}, @code{cl-dolist}, @code{cl-do-symbols}. |
| 860 | * Loop Facility:: The Common Lisp @code{loop} macro | 834 | * Loop Facility:: The Common Lisp @code{cl-loop} macro. |
| 861 | * Multiple Values:: @code{values}, @code{multiple-value-bind}, etc. | 835 | * Multiple Values:: @code{values}, @code{cl-multiple-value-bind}, etc. |
| 862 | @end menu | 836 | @end menu |
| 863 | 837 | ||
| 864 | @node Assignment | 838 | @node Assignment |
| 865 | @section Assignment | 839 | @section Assignment |
| 866 | 840 | ||
| 867 | @noindent | 841 | @noindent |
| 868 | The @code{psetq} form is just like @code{setq}, except that multiple | 842 | The @code{cl-psetq} form is just like @code{setq}, except that multiple |
| 869 | assignments are done in parallel rather than sequentially. | 843 | assignments are done in parallel rather than sequentially. |
| 870 | 844 | ||
| 871 | @defspec psetq [symbol form]@dots{} | 845 | @defspec cl-psetq [symbol form]@dots{} |
| 872 | This special form (actually a macro) is used to assign to several | 846 | This special form (actually a macro) is used to assign to several |
| 873 | variables simultaneously. Given only one @var{symbol} and @var{form}, | 847 | variables simultaneously. Given only one @var{symbol} and @var{form}, |
| 874 | it has the same effect as @code{setq}. Given several @var{symbol} | 848 | it has the same effect as @code{setq}. Given several @var{symbol} |
| @@ -883,21 +857,22 @@ x | |||
| 883 | y ; @r{@code{y} was computed after @code{x} was set.} | 857 | y ; @r{@code{y} was computed after @code{x} was set.} |
| 884 | @result{} 15 | 858 | @result{} 15 |
| 885 | (setq x 2 y 3) | 859 | (setq x 2 y 3) |
| 886 | (psetq x (+ x y) y (* x y)) | 860 | (cl-psetq x (+ x y) y (* x y)) |
| 887 | x | 861 | x |
| 888 | @result{} 5 | 862 | @result{} 5 |
| 889 | y ; @r{@code{y} was computed before @code{x} was set.} | 863 | y ; @r{@code{y} was computed before @code{x} was set.} |
| 890 | @result{} 6 | 864 | @result{} 6 |
| 891 | @end example | 865 | @end example |
| 892 | 866 | ||
| 893 | The simplest use of @code{psetq} is @code{(psetq x y y x)}, which | 867 | The simplest use of @code{cl-psetq} is @code{(cl-psetq x y y x)}, which |
| 894 | exchanges the values of two variables. (The @code{rotatef} form | 868 | exchanges the values of two variables. (The @code{cl-rotatef} form |
| 895 | provides an even more convenient way to swap two variables; | 869 | provides an even more convenient way to swap two variables; |
| 896 | @pxref{Modify Macros}.) | 870 | @pxref{Modify Macros}.) |
| 897 | 871 | ||
| 898 | @code{psetq} always returns @code{nil}. | 872 | @code{cl-psetq} always returns @code{nil}. |
| 899 | @end defspec | 873 | @end defspec |
| 900 | 874 | ||
| 875 | @c FIXME now in gv.el. | ||
| 901 | @node Generalized Variables | 876 | @node Generalized Variables |
| 902 | @section Generalized Variables | 877 | @section Generalized Variables |
| 903 | 878 | ||
| @@ -922,9 +897,9 @@ Just as certain forms like @code{a[i]} can be lvalues in C, there | |||
| 922 | is a set of forms that can be generalized variables in Lisp. | 897 | is a set of forms that can be generalized variables in Lisp. |
| 923 | 898 | ||
| 924 | @menu | 899 | @menu |
| 925 | * Basic Setf:: @code{setf} and place forms | 900 | * Basic Setf:: @code{setf} and place forms. |
| 926 | * Modify Macros:: @code{incf}, @code{push}, @code{rotatef}, @code{letf}, @code{callf}, etc. | 901 | * Modify Macros:: @code{cl-incf}, @code{push}, @code{cl-rotatef}, @code{letf}, @code{cl-callf}, etc. |
| 927 | * Customizing Setf:: @code{define-modify-macro}, @code{defsetf}, @code{define-setf-method} | 902 | * Customizing Setf:: @code{define-modify-macro}, @code{defsetf}, @code{define-setf-method}. |
| 928 | @end menu | 903 | @end menu |
| 929 | 904 | ||
| 930 | @node Basic Setf | 905 | @node Basic Setf |
| @@ -1107,7 +1082,7 @@ that operate on generalized variables. Many are interesting and | |||
| 1107 | useful even when the @var{place} is just a variable name. | 1082 | useful even when the @var{place} is just a variable name. |
| 1108 | 1083 | ||
| 1109 | @defspec psetf [place form]@dots{} | 1084 | @defspec psetf [place form]@dots{} |
| 1110 | This macro is to @code{setf} what @code{psetq} is to @code{setq}: | 1085 | This macro is to @code{setf} what @code{cl-psetq} is to @code{setq}: |
| 1111 | When several @var{place}s and @var{form}s are involved, the | 1086 | When several @var{place}s and @var{form}s are involved, the |
| 1112 | assignments take place in parallel rather than sequentially. | 1087 | assignments take place in parallel rather than sequentially. |
| 1113 | Specifically, all subforms are evaluated from left to right, then | 1088 | Specifically, all subforms are evaluated from left to right, then |
| @@ -1533,10 +1508,10 @@ analogous to Lisp's built-in @code{let} form. | |||
| 1533 | are also related to variable bindings. | 1508 | are also related to variable bindings. |
| 1534 | 1509 | ||
| 1535 | @menu | 1510 | @menu |
| 1536 | * Dynamic Bindings:: The @code{progv} form | 1511 | * Dynamic Bindings:: The @code{progv} form. |
| 1537 | * Lexical Bindings:: @code{lexical-let} and lexical closures | 1512 | * Lexical Bindings:: @code{lexical-let} and lexical closures. |
| 1538 | * Function Bindings:: @code{flet} and @code{labels} | 1513 | * Function Bindings:: @code{flet} and @code{labels}. |
| 1539 | * Macro Bindings:: @code{macrolet} and @code{symbol-macrolet} | 1514 | * Macro Bindings:: @code{macrolet} and @code{symbol-macrolet}. |
| 1540 | @end menu | 1515 | @end menu |
| 1541 | 1516 | ||
| 1542 | @node Dynamic Bindings | 1517 | @node Dynamic Bindings |
| @@ -1563,7 +1538,7 @@ are ignored. | |||
| 1563 | @subsection Lexical Bindings | 1538 | @subsection Lexical Bindings |
| 1564 | 1539 | ||
| 1565 | @noindent | 1540 | @noindent |
| 1566 | The @dfn{CL} package defines the following macro which | 1541 | The @code{CL} package defines the following macro which |
| 1567 | more closely follows the Common Lisp @code{let} form: | 1542 | more closely follows the Common Lisp @code{let} form: |
| 1568 | 1543 | ||
| 1569 | @defspec lexical-let (bindings@dots{}) forms@dots{} | 1544 | @defspec lexical-let (bindings@dots{}) forms@dots{} |
| @@ -1984,7 +1959,7 @@ looping constructs to complement Emacs Lisp's basic @code{while} | |||
| 1984 | loop. | 1959 | loop. |
| 1985 | 1960 | ||
| 1986 | @defspec loop forms@dots{} | 1961 | @defspec loop forms@dots{} |
| 1987 | The @dfn{CL} package supports both the simple, old-style meaning of | 1962 | The @code{CL} package supports both the simple, old-style meaning of |
| 1988 | @code{loop} and the extremely powerful and flexible feature known as | 1963 | @code{loop} and the extremely powerful and flexible feature known as |
| 1989 | the @dfn{Loop Facility} or @dfn{Loop Macro}. This more advanced | 1964 | the @dfn{Loop Facility} or @dfn{Loop Macro}. This more advanced |
| 1990 | facility is discussed in the following section; @pxref{Loop Facility}. | 1965 | facility is discussed in the following section; @pxref{Loop Facility}. |
| @@ -2026,7 +2001,7 @@ associated @var{init} value as if by a @code{let} form. Then, in | |||
| 2026 | each iteration of the loop, the @var{end-test} is evaluated; if | 2001 | each iteration of the loop, the @var{end-test} is evaluated; if |
| 2027 | true, the loop is finished. Otherwise, the body @var{forms} are | 2002 | true, the loop is finished. Otherwise, the body @var{forms} are |
| 2028 | evaluated, then each @var{var} is set to the associated @var{step} | 2003 | evaluated, then each @var{var} is set to the associated @var{step} |
| 2029 | expression (as if by a @code{psetq} form) and the next iteration | 2004 | expression (as if by a @code{cl-psetq} form) and the next iteration |
| 2030 | begins. Once the @var{end-test} becomes true, the @var{result} | 2005 | begins. Once the @var{end-test} becomes true, the @var{result} |
| 2031 | forms are evaluated (with the @var{var}s still bound to their | 2006 | forms are evaluated (with the @var{var}s still bound to their |
| 2032 | values) to produce the result returned by @code{do}. | 2007 | values) to produce the result returned by @code{do}. |
| @@ -2065,7 +2040,7 @@ the rest of the loop. | |||
| 2065 | This is to @code{do} what @code{let*} is to @code{let}. In | 2040 | This is to @code{do} what @code{let*} is to @code{let}. In |
| 2066 | particular, the initial values are bound as if by @code{let*} | 2041 | particular, the initial values are bound as if by @code{let*} |
| 2067 | rather than @code{let}, and the steps are assigned as if by | 2042 | rather than @code{let}, and the steps are assigned as if by |
| 2068 | @code{setq} rather than @code{psetq}. | 2043 | @code{setq} rather than @code{cl-psetq}. |
| 2069 | 2044 | ||
| 2070 | Here is another way to write the above loop: | 2045 | Here is another way to write the above loop: |
| 2071 | 2046 | ||
| @@ -2133,12 +2108,12 @@ construct called the ``Loop Facility'' or ``@code{loop} macro,'' | |||
| 2133 | with an easy-to-use but very powerful and expressive syntax. | 2108 | with an easy-to-use but very powerful and expressive syntax. |
| 2134 | 2109 | ||
| 2135 | @menu | 2110 | @menu |
| 2136 | * Loop Basics:: @code{loop} macro, basic clause structure | 2111 | * Loop Basics:: @code{loop} macro, basic clause structure. |
| 2137 | * Loop Examples:: Working examples of @code{loop} macro | 2112 | * Loop Examples:: Working examples of @code{loop} macro. |
| 2138 | * For Clauses:: Clauses introduced by @code{for} or @code{as} | 2113 | * For Clauses:: Clauses introduced by @code{for} or @code{as}. |
| 2139 | * Iteration Clauses:: @code{repeat}, @code{while}, @code{thereis}, etc. | 2114 | * Iteration Clauses:: @code{repeat}, @code{while}, @code{thereis}, etc. |
| 2140 | * Accumulation Clauses:: @code{collect}, @code{sum}, @code{maximize}, etc. | 2115 | * Accumulation Clauses:: @code{collect}, @code{sum}, @code{maximize}, etc. |
| 2141 | * Other Clauses:: @code{with}, @code{if}, @code{initially}, @code{finally} | 2116 | * Other Clauses:: @code{with}, @code{if}, @code{initially}, @code{finally}. |
| 2142 | @end menu | 2117 | @end menu |
| 2143 | 2118 | ||
| 2144 | @node Loop Basics | 2119 | @node Loop Basics |
| @@ -2546,7 +2521,7 @@ If you include several @code{for} clauses in a row, they are | |||
| 2546 | treated sequentially (as if by @code{let*} and @code{setq}). | 2521 | treated sequentially (as if by @code{let*} and @code{setq}). |
| 2547 | You can instead use the word @code{and} to link the clauses, | 2522 | You can instead use the word @code{and} to link the clauses, |
| 2548 | in which case they are processed in parallel (as if by @code{let} | 2523 | in which case they are processed in parallel (as if by @code{let} |
| 2549 | and @code{psetq}). | 2524 | and @code{cl-psetq}). |
| 2550 | 2525 | ||
| 2551 | @example | 2526 | @example |
| 2552 | (loop for x below 5 for y = nil then x collect (list x y)) | 2527 | (loop for x below 5 for y = nil then x collect (list x y)) |
| @@ -3177,8 +3152,8 @@ This package defines several symbol-related features that were | |||
| 3177 | missing from Emacs Lisp. | 3152 | missing from Emacs Lisp. |
| 3178 | 3153 | ||
| 3179 | @menu | 3154 | @menu |
| 3180 | * Property Lists:: @code{get*}, @code{remprop}, @code{getf}, @code{remf} | 3155 | * Property Lists:: @code{get*}, @code{remprop}, @code{getf}, @code{remf}. |
| 3181 | * Creating Symbols:: @code{gensym}, @code{gentemp} | 3156 | * Creating Symbols:: @code{gensym}, @code{gentemp}. |
| 3182 | @end menu | 3157 | @end menu |
| 3183 | 3158 | ||
| 3184 | @node Property Lists | 3159 | @node Property Lists |
| @@ -3321,8 +3296,8 @@ which were left out of Emacs Lisp. | |||
| 3321 | @menu | 3296 | @menu |
| 3322 | * Predicates on Numbers:: @code{plusp}, @code{oddp}, @code{floatp-safe}, etc. | 3297 | * Predicates on Numbers:: @code{plusp}, @code{oddp}, @code{floatp-safe}, etc. |
| 3323 | * Numerical Functions:: @code{abs}, @code{floor*}, etc. | 3298 | * Numerical Functions:: @code{abs}, @code{floor*}, etc. |
| 3324 | * Random Numbers:: @code{random*}, @code{make-random-state} | 3299 | * Random Numbers:: @code{random*}, @code{make-random-state}. |
| 3325 | * Implementation Parameters:: @code{most-positive-float} | 3300 | * Implementation Parameters:: @code{most-positive-float}. |
| 3326 | @end menu | 3301 | @end menu |
| 3327 | 3302 | ||
| 3328 | @iftex | 3303 | @iftex |
| @@ -3614,11 +3589,11 @@ Emacs Lisp includes a few of these, notably @code{elt} and | |||
| 3614 | @code{length}; this package defines most of the rest. | 3589 | @code{length}; this package defines most of the rest. |
| 3615 | 3590 | ||
| 3616 | @menu | 3591 | @menu |
| 3617 | * Sequence Basics:: Arguments shared by all sequence functions | 3592 | * Sequence Basics:: Arguments shared by all sequence functions. |
| 3618 | * Mapping over Sequences:: @code{mapcar*}, @code{mapcan}, @code{map}, @code{every}, etc. | 3593 | * Mapping over Sequences:: @code{mapcar*}, @code{mapcan}, @code{map}, @code{every}, etc. |
| 3619 | * Sequence Functions:: @code{subseq}, @code{remove*}, @code{substitute}, etc. | 3594 | * Sequence Functions:: @code{subseq}, @code{remove*}, @code{substitute}, etc. |
| 3620 | * Searching Sequences:: @code{find}, @code{position}, @code{count}, @code{search}, etc. | 3595 | * Searching Sequences:: @code{find}, @code{position}, @code{count}, @code{search}, etc. |
| 3621 | * Sorting Sequences:: @code{sort*}, @code{stable-sort}, @code{merge} | 3596 | * Sorting Sequences:: @code{sort*}, @code{stable-sort}, @code{merge}. |
| 3622 | @end menu | 3597 | @end menu |
| 3623 | 3598 | ||
| 3624 | @node Sequence Basics | 3599 | @node Sequence Basics |
| @@ -4101,7 +4076,7 @@ The functions described here operate on lists. | |||
| 4101 | * List Functions:: @code{caddr}, @code{first}, @code{list*}, etc. | 4076 | * List Functions:: @code{caddr}, @code{first}, @code{list*}, etc. |
| 4102 | * Substitution of Expressions:: @code{subst}, @code{sublis}, etc. | 4077 | * Substitution of Expressions:: @code{subst}, @code{sublis}, etc. |
| 4103 | * Lists as Sets:: @code{member*}, @code{adjoin}, @code{union}, etc. | 4078 | * Lists as Sets:: @code{member*}, @code{adjoin}, @code{union}, etc. |
| 4104 | * Association Lists:: @code{assoc*}, @code{rassoc*}, @code{acons}, @code{pairlis} | 4079 | * Association Lists:: @code{assoc*}, @code{rassoc*}, @code{acons}, @code{pairlis}. |
| 4105 | @end menu | 4080 | @end menu |
| 4106 | 4081 | ||
| 4107 | @node List Functions | 4082 | @node List Functions |
| @@ -5045,7 +5020,7 @@ Lisp. | |||
| 5045 | @appendixsec The @code{cl-compat} package | 5020 | @appendixsec The @code{cl-compat} package |
| 5046 | 5021 | ||
| 5047 | @noindent | 5022 | @noindent |
| 5048 | The @dfn{CL} package includes emulations of some features of the | 5023 | The @code{CL} package includes emulations of some features of the |
| 5049 | old @file{cl.el}, in the form of a compatibility package | 5024 | old @file{cl.el}, in the form of a compatibility package |
| 5050 | @code{cl-compat}. This file is obsolete and may be removed in future, | 5025 | @code{cl-compat}. This file is obsolete and may be removed in future, |
| 5051 | so it should not be used in new code. | 5026 | so it should not be used in new code. |
| @@ -5066,7 +5041,7 @@ best fix is to change to use @code{setf} properly. | |||
| 5066 | 5041 | ||
| 5067 | The @code{cl-compat} file defines the keyword functions | 5042 | The @code{cl-compat} file defines the keyword functions |
| 5068 | @code{keywordp}, @code{keyword-of}, and @code{defkeyword}, | 5043 | @code{keywordp}, @code{keyword-of}, and @code{defkeyword}, |
| 5069 | which are not defined by the new @dfn{CL} package because the | 5044 | which are not defined by the new @code{CL} package because the |
| 5070 | use of keywords as data is discouraged. | 5045 | use of keywords as data is discouraged. |
| 5071 | 5046 | ||
| 5072 | The @code{build-klist} mechanism for parsing keyword arguments | 5047 | The @code{build-klist} mechanism for parsing keyword arguments |