diff options
| author | Glenn Morris | 2012-11-03 11:23:38 -0700 |
|---|---|---|
| committer | Glenn Morris | 2012-11-03 11:23:38 -0700 |
| commit | 3a4d19175aaf8ba6d43dac0bb2be703def774bd8 (patch) | |
| tree | b42d6d07e1e7a9970bd0528c60d5f46211685e6e | |
| parent | 5c677d44107c87c6d89090e4052adba44fd12de3 (diff) | |
| download | emacs-3a4d19175aaf8ba6d43dac0bb2be703def774bd8.tar.gz emacs-3a4d19175aaf8ba6d43dac0bb2be703def774bd8.zip | |
More general edits for cl.texi Appendices
| -rw-r--r-- | doc/misc/cl.texi | 45 |
1 files changed, 27 insertions, 18 deletions
diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index 593985edbfc..1b1a3f9836f 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi | |||
| @@ -4479,25 +4479,27 @@ referenced by @code{cl-return} or @code{cl-return-from} inside the block. | |||
| 4479 | @appendix Common Lisp Compatibility | 4479 | @appendix Common Lisp Compatibility |
| 4480 | 4480 | ||
| 4481 | @noindent | 4481 | @noindent |
| 4482 | Following is a list of all known incompatibilities between this | 4482 | The following is a list of all known incompatibilities between this |
| 4483 | package and Common Lisp as documented in Steele (2nd edition). | 4483 | package and Common Lisp as documented in Steele (2nd edition). |
| 4484 | 4484 | ||
| 4485 | The word @code{cl-defun} is required instead of @code{defun} in order | 4485 | The word @code{cl-defun} is required instead of @code{defun} in order |
| 4486 | to use extended Common Lisp argument lists in a function. Likewise, | 4486 | to use extended Common Lisp argument lists in a function. Likewise, |
| 4487 | @code{cl-defmacro} and @code{cl-function} are versions of those forms | 4487 | @code{cl-defmacro} and @code{cl-function} are versions of those forms |
| 4488 | which understand full-featured argument lists. The @code{&whole} | 4488 | which understand full-featured argument lists. The @code{&whole} |
| 4489 | keyword does not work in @code{defmacro} argument lists (except | 4489 | keyword does not work in @code{cl-defmacro} argument lists (except |
| 4490 | inside recursive argument lists). | 4490 | inside recursive argument lists). |
| 4491 | 4491 | ||
| 4492 | The @code{equal} predicate does not distinguish | 4492 | The @code{equal} predicate does not distinguish |
| 4493 | between IEEE floating-point plus and minus zero. The @code{cl-equalp} | 4493 | between IEEE floating-point plus and minus zero. The @code{cl-equalp} |
| 4494 | predicate has several differences with Common Lisp; @pxref{Predicates}. | 4494 | predicate has several differences with Common Lisp; @pxref{Predicates}. |
| 4495 | 4495 | ||
| 4496 | @c FIXME no longer provided by cl. | 4496 | @c FIXME consider moving to lispref |
| 4497 | @ignore | ||
| 4497 | The @code{setf} mechanism is entirely compatible, except that | 4498 | The @code{setf} mechanism is entirely compatible, except that |
| 4498 | setf-methods return a list of five values rather than five | 4499 | setf-methods return a list of five values rather than five |
| 4499 | values directly. Also, the new ``@code{setf} function'' concept | 4500 | values directly. Also, the new ``@code{setf} function'' concept |
| 4500 | (typified by @code{(defun (setf foo) @dots{})}) is not implemented. | 4501 | (typified by @code{(defun (setf foo) @dots{})}) is not implemented. |
| 4502 | @end ignore | ||
| 4501 | 4503 | ||
| 4502 | The @code{cl-do-all-symbols} form is the same as @code{cl-do-symbols} | 4504 | The @code{cl-do-all-symbols} form is the same as @code{cl-do-symbols} |
| 4503 | with no @var{obarray} argument. In Common Lisp, this form would | 4505 | with no @var{obarray} argument. In Common Lisp, this form would |
| @@ -4630,7 +4632,7 @@ However, the Emacs parser does not understand colons and just | |||
| 4630 | treats them as part of the symbol name. Thus, while @code{mapcar} | 4632 | treats them as part of the symbol name. Thus, while @code{mapcar} |
| 4631 | and @code{lisp:mapcar} may refer to the same symbol in Common | 4633 | and @code{lisp:mapcar} may refer to the same symbol in Common |
| 4632 | Lisp, they are totally distinct in Emacs Lisp. Common Lisp | 4634 | Lisp, they are totally distinct in Emacs Lisp. Common Lisp |
| 4633 | programs which refer to a symbol by the full name sometimes | 4635 | programs that refer to a symbol by the full name sometimes |
| 4634 | and the short name other times will not port cleanly to Emacs. | 4636 | and the short name other times will not port cleanly to Emacs. |
| 4635 | 4637 | ||
| 4636 | Emacs Lisp does have a concept of ``obarrays'', which are | 4638 | Emacs Lisp does have a concept of ``obarrays'', which are |
| @@ -4917,8 +4919,9 @@ Common Lisp defines three macros, @code{define-modify-macro}, | |||
| 4917 | @code{defsetf}, and @code{define-setf-method}, that allow the | 4919 | @code{defsetf}, and @code{define-setf-method}, that allow the |
| 4918 | user to extend generalized variables in various ways. | 4920 | user to extend generalized variables in various ways. |
| 4919 | In Emacs, these are obsolete, replaced by various features of | 4921 | In Emacs, these are obsolete, replaced by various features of |
| 4920 | @file{gv.el} in Emacs 24.3. | 4922 | @file{gv.el} in Emacs 24.3. Many of the implementation |
| 4921 | @c FIXME details. | 4923 | details in the following are out-of-date. |
| 4924 | @c FIXME this whole section needs updating. | ||
| 4922 | 4925 | ||
| 4923 | @defmac define-modify-macro name arglist function [doc-string] | 4926 | @defmac define-modify-macro name arglist function [doc-string] |
| 4924 | This macro defines a ``read-modify-write'' macro similar to | 4927 | This macro defines a ``read-modify-write'' macro similar to |
| @@ -4987,7 +4990,7 @@ Otherwise, the above expansion would not obey the rules for the way | |||
| 4987 | @code{setf} is supposed to behave. | 4990 | @code{setf} is supposed to behave. |
| 4988 | 4991 | ||
| 4989 | As a special (non-Common-Lisp) extension, a third argument of @code{t} | 4992 | As a special (non-Common-Lisp) extension, a third argument of @code{t} |
| 4990 | to @code{defsetf} says that the @code{update-fn}'s return value is | 4993 | to @code{defsetf} says that the return value of @code{update-fn} is |
| 4991 | not suitable, so that the above @code{setf} should be expanded to | 4994 | not suitable, so that the above @code{setf} should be expanded to |
| 4992 | something more like | 4995 | something more like |
| 4993 | 4996 | ||
| @@ -5010,7 +5013,7 @@ suite of setf methods, are: | |||
| 5010 | @defmac defsetf access-fn arglist (store-var) forms@dots{} | 5013 | @defmac defsetf access-fn arglist (store-var) forms@dots{} |
| 5011 | This is the second, more complex, form of @code{defsetf}. It is | 5014 | This is the second, more complex, form of @code{defsetf}. It is |
| 5012 | rather like @code{defmacro} except for the additional @var{store-var} | 5015 | rather like @code{defmacro} except for the additional @var{store-var} |
| 5013 | argument. The @var{forms} should return a Lisp form which stores | 5016 | argument. The @var{forms} should return a Lisp form that stores |
| 5014 | the value of @var{store-var} into the generalized variable formed | 5017 | the value of @var{store-var} into the generalized variable formed |
| 5015 | by a call to @var{access-fn} with arguments described by @var{arglist}. | 5018 | by a call to @var{access-fn} with arguments described by @var{arglist}. |
| 5016 | The @var{forms} may begin with a string which documents the @code{setf} | 5019 | The @var{forms} may begin with a string which documents the @code{setf} |
| @@ -5026,7 +5029,7 @@ For example, the simple form of @code{defsetf} is shorthand for | |||
| 5026 | 5029 | ||
| 5027 | The Lisp form that is returned can access the arguments from | 5030 | The Lisp form that is returned can access the arguments from |
| 5028 | @var{arglist} and @var{store-var} in an unrestricted fashion; | 5031 | @var{arglist} and @var{store-var} in an unrestricted fashion; |
| 5029 | macros like @code{setf} and @code{cl-incf} which invoke this | 5032 | macros like @code{cl-incf} that invoke this |
| 5030 | setf-method will insert temporary variables as needed to make | 5033 | setf-method will insert temporary variables as needed to make |
| 5031 | sure the apparent order of evaluation is preserved. | 5034 | sure the apparent order of evaluation is preserved. |
| 5032 | 5035 | ||
| @@ -5043,6 +5046,7 @@ This is the most general way to create new place forms. When | |||
| 5043 | a @code{setf} to @var{access-fn} with arguments described by | 5046 | a @code{setf} to @var{access-fn} with arguments described by |
| 5044 | @var{arglist} is expanded, the @var{forms} are evaluated and | 5047 | @var{arglist} is expanded, the @var{forms} are evaluated and |
| 5045 | must return a list of five items: | 5048 | must return a list of five items: |
| 5049 | @c FIXME Is this still true? | ||
| 5046 | 5050 | ||
| 5047 | @enumerate | 5051 | @enumerate |
| 5048 | @item | 5052 | @item |
| @@ -5058,12 +5062,12 @@ A list of exactly one @dfn{store variable} (generally obtained | |||
| 5058 | from a call to @code{gensym}). | 5062 | from a call to @code{gensym}). |
| 5059 | 5063 | ||
| 5060 | @item | 5064 | @item |
| 5061 | A Lisp form which stores the contents of the store variable into | 5065 | A Lisp form that stores the contents of the store variable into |
| 5062 | the generalized variable, assuming the temporaries have been | 5066 | the generalized variable, assuming the temporaries have been |
| 5063 | bound as described above. | 5067 | bound as described above. |
| 5064 | 5068 | ||
| 5065 | @item | 5069 | @item |
| 5066 | A Lisp form which accesses the contents of the generalized variable, | 5070 | A Lisp form that accesses the contents of the generalized variable, |
| 5067 | assuming the temporaries have been bound. | 5071 | assuming the temporaries have been bound. |
| 5068 | @end enumerate | 5072 | @end enumerate |
| 5069 | 5073 | ||
| @@ -5079,7 +5083,8 @@ temporary variables. In the setf-methods generated by | |||
| 5079 | @code{defsetf}, the second return value is simply the list of | 5083 | @code{defsetf}, the second return value is simply the list of |
| 5080 | arguments in the place form, and the first return value is a | 5084 | arguments in the place form, and the first return value is a |
| 5081 | list of a corresponding number of temporary variables generated | 5085 | list of a corresponding number of temporary variables generated |
| 5082 | by @code{cl-gensym}. Macros like @code{setf} and @code{cl-incf} which | 5086 | @c FIXME I don't think this is true anymore. |
| 5087 | by @code{cl-gensym}. Macros like @code{cl-incf} that | ||
| 5083 | use this setf-method will optimize away most temporaries that | 5088 | use this setf-method will optimize away most temporaries that |
| 5084 | turn out to be unnecessary, so there is little reason for the | 5089 | turn out to be unnecessary, so there is little reason for the |
| 5085 | setf-method itself to optimize. | 5090 | setf-method itself to optimize. |
| @@ -5090,12 +5095,14 @@ This function returns the setf-method for @var{place}, by | |||
| 5090 | invoking the definition previously recorded by @code{defsetf} | 5095 | invoking the definition previously recorded by @code{defsetf} |
| 5091 | or @code{define-setf-method}. The result is a list of five | 5096 | or @code{define-setf-method}. The result is a list of five |
| 5092 | values as described above. You can use this function to build | 5097 | values as described above. You can use this function to build |
| 5093 | your own @code{cl-incf}-like modify macros. (Actually, it is | 5098 | your own @code{cl-incf}-like modify macros. |
| 5094 | @c FIXME? | 5099 | @c These no longer exist. |
| 5095 | better to use the internal functions @code{cl-setf-do-modify} | 5100 | @ignore |
| 5096 | and @code{cl-setf-do-store}, which are a bit easier to use and | 5101 | (Actually, it is better to use the internal functions |
| 5097 | which also do a number of optimizations; consult the source | 5102 | @code{cl-setf-do-modify} and @code{cl-setf-do-store}, which are a bit |
| 5098 | code for the @code{cl-incf} function for a simple example.) | 5103 | easier to use and which also do a number of optimizations; consult the |
| 5104 | source code for the @code{cl-incf} function for a simple example.) | ||
| 5105 | @end ignore | ||
| 5099 | 5106 | ||
| 5100 | The argument @var{env} specifies the ``environment'' to be | 5107 | The argument @var{env} specifies the ``environment'' to be |
| 5101 | passed on to @code{macroexpand} if @code{get-setf-method} should | 5108 | passed on to @code{macroexpand} if @code{get-setf-method} should |
| @@ -5103,12 +5110,14 @@ need to expand a macro in @var{place}. It should come from | |||
| 5103 | an @code{&environment} argument to the macro or setf-method | 5110 | an @code{&environment} argument to the macro or setf-method |
| 5104 | that called @code{get-setf-method}. | 5111 | that called @code{get-setf-method}. |
| 5105 | 5112 | ||
| 5113 | @c FIXME No longer true. | ||
| 5106 | See also the source code for the setf-method for | 5114 | See also the source code for the setf-method for |
| 5107 | @c Also @code{apply}, but that is commented out. | 5115 | @c Also @code{apply}, but that is commented out. |
| 5108 | @code{substring}, which works by calling @code{get-setf-method} on a | 5116 | @code{substring}, which works by calling @code{get-setf-method} on a |
| 5109 | simpler case, then massaging the result. | 5117 | simpler case, then massaging the result. |
| 5110 | @end defun | 5118 | @end defun |
| 5111 | 5119 | ||
| 5120 | @c FIXME does not belong here any more, maybe in lispref? | ||
| 5112 | Modern Common Lisp defines a second, independent way to specify | 5121 | Modern Common Lisp defines a second, independent way to specify |
| 5113 | the @code{setf} behavior of a function, namely ``@code{setf} | 5122 | the @code{setf} behavior of a function, namely ``@code{setf} |
| 5114 | functions'' whose names are lists @code{(setf @var{name})} | 5123 | functions'' whose names are lists @code{(setf @var{name})} |