aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2012-11-03 11:23:38 -0700
committerGlenn Morris2012-11-03 11:23:38 -0700
commit3a4d19175aaf8ba6d43dac0bb2be703def774bd8 (patch)
treeb42d6d07e1e7a9970bd0528c60d5f46211685e6e
parent5c677d44107c87c6d89090e4052adba44fd12de3 (diff)
downloademacs-3a4d19175aaf8ba6d43dac0bb2be703def774bd8.tar.gz
emacs-3a4d19175aaf8ba6d43dac0bb2be703def774bd8.zip
More general edits for cl.texi Appendices
-rw-r--r--doc/misc/cl.texi45
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
4482Following is a list of all known incompatibilities between this 4482The following is a list of all known incompatibilities between this
4483package and Common Lisp as documented in Steele (2nd edition). 4483package and Common Lisp as documented in Steele (2nd edition).
4484 4484
4485The word @code{cl-defun} is required instead of @code{defun} in order 4485The word @code{cl-defun} is required instead of @code{defun} in order
4486to use extended Common Lisp argument lists in a function. Likewise, 4486to 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
4488which understand full-featured argument lists. The @code{&whole} 4488which understand full-featured argument lists. The @code{&whole}
4489keyword does not work in @code{defmacro} argument lists (except 4489keyword does not work in @code{cl-defmacro} argument lists (except
4490inside recursive argument lists). 4490inside recursive argument lists).
4491 4491
4492The @code{equal} predicate does not distinguish 4492The @code{equal} predicate does not distinguish
4493between IEEE floating-point plus and minus zero. The @code{cl-equalp} 4493between IEEE floating-point plus and minus zero. The @code{cl-equalp}
4494predicate has several differences with Common Lisp; @pxref{Predicates}. 4494predicate 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
4497The @code{setf} mechanism is entirely compatible, except that 4498The @code{setf} mechanism is entirely compatible, except that
4498setf-methods return a list of five values rather than five 4499setf-methods return a list of five values rather than five
4499values directly. Also, the new ``@code{setf} function'' concept 4500values 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
4502The @code{cl-do-all-symbols} form is the same as @code{cl-do-symbols} 4504The @code{cl-do-all-symbols} form is the same as @code{cl-do-symbols}
4503with no @var{obarray} argument. In Common Lisp, this form would 4505with no @var{obarray} argument. In Common Lisp, this form would
@@ -4630,7 +4632,7 @@ However, the Emacs parser does not understand colons and just
4630treats them as part of the symbol name. Thus, while @code{mapcar} 4632treats them as part of the symbol name. Thus, while @code{mapcar}
4631and @code{lisp:mapcar} may refer to the same symbol in Common 4633and @code{lisp:mapcar} may refer to the same symbol in Common
4632Lisp, they are totally distinct in Emacs Lisp. Common Lisp 4634Lisp, they are totally distinct in Emacs Lisp. Common Lisp
4633programs which refer to a symbol by the full name sometimes 4635programs that refer to a symbol by the full name sometimes
4634and the short name other times will not port cleanly to Emacs. 4636and the short name other times will not port cleanly to Emacs.
4635 4637
4636Emacs Lisp does have a concept of ``obarrays'', which are 4638Emacs 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
4918user to extend generalized variables in various ways. 4920user to extend generalized variables in various ways.
4919In Emacs, these are obsolete, replaced by various features of 4921In 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. 4923details 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]
4924This macro defines a ``read-modify-write'' macro similar to 4927This 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
4989As a special (non-Common-Lisp) extension, a third argument of @code{t} 4992As a special (non-Common-Lisp) extension, a third argument of @code{t}
4990to @code{defsetf} says that the @code{update-fn}'s return value is 4993to @code{defsetf} says that the return value of @code{update-fn} is
4991not suitable, so that the above @code{setf} should be expanded to 4994not suitable, so that the above @code{setf} should be expanded to
4992something more like 4995something 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{}
5011This is the second, more complex, form of @code{defsetf}. It is 5014This is the second, more complex, form of @code{defsetf}. It is
5012rather like @code{defmacro} except for the additional @var{store-var} 5015rather like @code{defmacro} except for the additional @var{store-var}
5013argument. The @var{forms} should return a Lisp form which stores 5016argument. The @var{forms} should return a Lisp form that stores
5014the value of @var{store-var} into the generalized variable formed 5017the value of @var{store-var} into the generalized variable formed
5015by a call to @var{access-fn} with arguments described by @var{arglist}. 5018by a call to @var{access-fn} with arguments described by @var{arglist}.
5016The @var{forms} may begin with a string which documents the @code{setf} 5019The @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
5027The Lisp form that is returned can access the arguments from 5030The 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;
5029macros like @code{setf} and @code{cl-incf} which invoke this 5032macros like @code{cl-incf} that invoke this
5030setf-method will insert temporary variables as needed to make 5033setf-method will insert temporary variables as needed to make
5031sure the apparent order of evaluation is preserved. 5034sure 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
5043a @code{setf} to @var{access-fn} with arguments described by 5046a @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
5045must return a list of five items: 5048must 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
5058from a call to @code{gensym}). 5062from a call to @code{gensym}).
5059 5063
5060@item 5064@item
5061A Lisp form which stores the contents of the store variable into 5065A Lisp form that stores the contents of the store variable into
5062the generalized variable, assuming the temporaries have been 5066the generalized variable, assuming the temporaries have been
5063bound as described above. 5067bound as described above.
5064 5068
5065@item 5069@item
5066A Lisp form which accesses the contents of the generalized variable, 5070A Lisp form that accesses the contents of the generalized variable,
5067assuming the temporaries have been bound. 5071assuming 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
5080arguments in the place form, and the first return value is a 5084arguments in the place form, and the first return value is a
5081list of a corresponding number of temporary variables generated 5085list of a corresponding number of temporary variables generated
5082by @code{cl-gensym}. Macros like @code{setf} and @code{cl-incf} which 5086@c FIXME I don't think this is true anymore.
5087by @code{cl-gensym}. Macros like @code{cl-incf} that
5083use this setf-method will optimize away most temporaries that 5088use this setf-method will optimize away most temporaries that
5084turn out to be unnecessary, so there is little reason for the 5089turn out to be unnecessary, so there is little reason for the
5085setf-method itself to optimize. 5090setf-method itself to optimize.
@@ -5090,12 +5095,14 @@ This function returns the setf-method for @var{place}, by
5090invoking the definition previously recorded by @code{defsetf} 5095invoking the definition previously recorded by @code{defsetf}
5091or @code{define-setf-method}. The result is a list of five 5096or @code{define-setf-method}. The result is a list of five
5092values as described above. You can use this function to build 5097values as described above. You can use this function to build
5093your own @code{cl-incf}-like modify macros. (Actually, it is 5098your own @code{cl-incf}-like modify macros.
5094@c FIXME? 5099@c These no longer exist.
5095better to use the internal functions @code{cl-setf-do-modify} 5100@ignore
5096and @code{cl-setf-do-store}, which are a bit easier to use and 5101(Actually, it is better to use the internal functions
5097which 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
5098code for the @code{cl-incf} function for a simple example.) 5103easier to use and which also do a number of optimizations; consult the
5104source code for the @code{cl-incf} function for a simple example.)
5105@end ignore
5099 5106
5100The argument @var{env} specifies the ``environment'' to be 5107The argument @var{env} specifies the ``environment'' to be
5101passed on to @code{macroexpand} if @code{get-setf-method} should 5108passed 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
5103an @code{&environment} argument to the macro or setf-method 5110an @code{&environment} argument to the macro or setf-method
5104that called @code{get-setf-method}. 5111that called @code{get-setf-method}.
5105 5112
5113@c FIXME No longer true.
5106See also the source code for the setf-method for 5114See 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
5109simpler case, then massaging the result. 5117simpler 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?
5112Modern Common Lisp defines a second, independent way to specify 5121Modern Common Lisp defines a second, independent way to specify
5113the @code{setf} behavior of a function, namely ``@code{setf} 5122the @code{setf} behavior of a function, namely ``@code{setf}
5114functions'' whose names are lists @code{(setf @var{name})} 5123functions'' whose names are lists @code{(setf @var{name})}