aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2000-11-08 14:31:51 +0000
committerStefan Monnier2000-11-08 14:31:51 +0000
commita9c498a57d1990d161d615cf335c077e3b16bd7e (patch)
tree1282f393a86506b77fc164a21c65d223c6867796
parent4faaa994b1a206e5d9b39721dbfa5b1d051f9589 (diff)
downloademacs-a9c498a57d1990d161d615cf335c077e3b16bd7e.tar.gz
emacs-a9c498a57d1990d161d615cf335c077e3b16bd7e.zip
Remove obsolete warnings about use of memq for keyword args.
-rw-r--r--man/cl.texi28
1 files changed, 1 insertions, 27 deletions
diff --git a/man/cl.texi b/man/cl.texi
index b5fb683b7c9..4aa01b32f6e 100644
--- a/man/cl.texi
+++ b/man/cl.texi
@@ -498,19 +498,6 @@ accepts other keyword arguments which are passed on to the
498keep both @code{find-thing} and @code{member*} from complaining 498keep both @code{find-thing} and @code{member*} from complaining
499about each others' keywords in the arguments. 499about each others' keywords in the arguments.
500 500
501As a (significant) performance optimization, this package
502implements the scan for keyword arguments by calling @code{memq}
503to search for keywords in a ``rest'' argument. Technically
504speaking, this is incorrect, since @code{memq} looks at the
505odd-numbered values as well as the even-numbered keywords.
506The net effect is that if you happen to pass a keyword symbol
507as the @emph{value} of another keyword argument, where that
508keyword symbol happens to equal the name of a valid keyword
509argument of the same function, then the keyword parser will
510become confused. This minor bug can only affect you if you
511use keyword symbols as general-purpose data in your program;
512this practice is strongly discouraged in Emacs Lisp.
513
514The fifth section of the argument list consists of @dfn{auxiliary 501The fifth section of the argument list consists of @dfn{auxiliary
515variables}. These are not really arguments at all, but simply 502variables}. These are not really arguments at all, but simply
516variables which are bound to @code{nil} or to the specified 503variables which are bound to @code{nil} or to the specified
@@ -4991,13 +4978,7 @@ have built-in compiler macros to optimize them in common cases.
4991Common Lisp compliance has in general not been sacrificed for the 4978Common Lisp compliance has in general not been sacrificed for the
4992sake of efficiency. A few exceptions have been made for cases 4979sake of efficiency. A few exceptions have been made for cases
4993where substantial gains were possible at the expense of marginal 4980where substantial gains were possible at the expense of marginal
4994incompatibility. One example is the use of @code{memq} (which is 4981incompatibility.
4995treated very efficiently by the byte-compiler) to scan for keyword
4996arguments; this can become confused in rare cases when keyword
4997symbols are used as both keywords and data values at once. This
4998is extremely unlikely to occur in practical code, and the use of
4999@code{memq} allows functions with keyword arguments to be nearly
5000as fast as functions that use @code{&optional} arguments.
5001 4982
5002The Common Lisp standard (as embodied in Steele's book) uses the 4983The Common Lisp standard (as embodied in Steele's book) uses the
5003phrase ``it is an error if'' to indicate a situation which is not 4984phrase ``it is an error if'' to indicate a situation which is not
@@ -5057,13 +5038,6 @@ which understand full-featured argument lists. The @code{&whole}
5057keyword does not work in @code{defmacro} argument lists (except 5038keyword does not work in @code{defmacro} argument lists (except
5058inside recursive argument lists). 5039inside recursive argument lists).
5059 5040
5060In order to allow an efficient implementation, keyword arguments use
5061a slightly cheesy parser which may be confused if a keyword symbol
5062is passed as the @emph{value} of another keyword argument.
5063(Specifically, @code{(memq :@var{keyword} @var{rest-of-arguments})}
5064is used to scan for @code{:@var{keyword}} among the supplied
5065keyword arguments.)
5066
5067The @code{eql} and @code{equal} predicates do not distinguish 5041The @code{eql} and @code{equal} predicates do not distinguish
5068between IEEE floating-point plus and minus zero. The @code{equalp} 5042between IEEE floating-point plus and minus zero. The @code{equalp}
5069predicate has several differences with Common Lisp; @pxref{Predicates}. 5043predicate has several differences with Common Lisp; @pxref{Predicates}.