aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2007-11-15 11:55:59 +0000
committerRichard M. Stallman2007-11-15 11:55:59 +0000
commit0a3333b5a69175bf284406e98a01a09b65f26b60 (patch)
tree8f420e734e2baedeac84bcc0538d2f5d34dd68fb
parent9ffb952120776aec512cabc9bb5af660f016bcac (diff)
downloademacs-0a3333b5a69175bf284406e98a01a09b65f26b60.tar.gz
emacs-0a3333b5a69175bf284406e98a01a09b65f26b60.zip
(Equality Predicates): Delete `eql'.
(Predicates, Naming Conventions, Top): Delete `eql'. (Common Lisp Compatibility): Delete `eql'. (Porting Common Lisp): Delete obsolete backquote info. Minor clarification about character constants. (Sequence Basics): Minor clarification.
-rw-r--r--man/cl.texi63
1 files changed, 12 insertions, 51 deletions
diff --git a/man/cl.texi b/man/cl.texi
index 676b9edc5ad..0a09caee98e 100644
--- a/man/cl.texi
+++ b/man/cl.texi
@@ -62,14 +62,14 @@ does assume a basic familiarity with Emacs Lisp.
62@menu 62@menu
63* Overview:: Installation, usage, etc. 63* Overview:: Installation, usage, etc.
64* Program Structure:: Arglists, `eval-when', `defalias' 64* Program Structure:: Arglists, `eval-when', `defalias'
65* Predicates:: `typep', `eql', and `equalp' 65* Predicates:: `typep' and `equalp'
66* Control Structure:: `setf', `do', `loop', etc. 66* Control Structure:: `setf', `do', `loop', etc.
67* Macros:: Destructuring, `define-compiler-macro' 67* Macros:: Destructuring, `define-compiler-macro'
68* Declarations:: `proclaim', `declare', etc. 68* Declarations:: `proclaim', `declare', etc.
69* Symbols:: Property lists, `gensym' 69* Symbols:: Property lists, `gensym'
70* Numbers:: Predicates, functions, random numbers 70* Numbers:: Predicates, functions, random numbers
71* Sequences:: Mapping, functions, searching, sorting 71* Sequences:: Mapping, functions, searching, sorting
72* Lists:: `cadr', `sublis', `member*', `assoc*', etc. 72* Lists:: `caddr', `sublis', `member*', `assoc*', etc.
73* Structures:: `defstruct' 73* Structures:: `defstruct'
74* Assertions:: `check-type', `assert', `ignore-errors'. 74* Assertions:: `check-type', `assert', `ignore-errors'.
75 75
@@ -287,7 +287,7 @@ The following simple functions and macros are defined in @file{cl.el};
287they do not cause other components like @file{cl-extra} to be loaded. 287they do not cause other components like @file{cl-extra} to be loaded.
288 288
289@example 289@example
290eql floatp-safe endp 290floatp-safe endp
291evenp oddp plusp minusp 291evenp oddp plusp minusp
292caaar .. cddddr 292caaar .. cddddr
293list* ldiff rest first .. tenth 293list* ldiff rest first .. tenth
@@ -700,7 +700,7 @@ facts are true or false.
700 700
701@menu 701@menu
702* Type Predicates:: `typep', `deftype', and `coerce' 702* Type Predicates:: `typep', `deftype', and `coerce'
703* Equality Predicates:: `eql' and `equalp' 703* Equality Predicates:: `equalp'
704@end menu 704@end menu
705 705
706@node Type Predicates, Equality Predicates, Predicates, Predicates 706@node Type Predicates, Equality Predicates, Predicates, Predicates
@@ -840,40 +840,7 @@ arguments to specify the type of sequence to return. @xref{Sequences}.
840@section Equality Predicates 840@section Equality Predicates
841 841
842@noindent 842@noindent
843This package defines two Common Lisp predicates, @code{eql} and 843This package defines the Common Lisp predicate @code{equalp}.
844@code{equalp}.
845
846@defun eql a b
847This function is almost the same as @code{eq}, except that if @var{a}
848and @var{b} are numbers of the same type, it compares them for numeric
849equality (as if by @code{equal} instead of @code{eq}). This makes a
850difference only for versions of Emacs that are compiled with
851floating-point support. Emacs floats are allocated
852objects just like cons cells, which means that @code{(eq 3.0 3.0)}
853will not necessarily be true---if the two @code{3.0}s were allocated
854separately, the pointers will be different even though the numbers are
855the same. But @code{(eql 3.0 3.0)} will always be true.
856
857The types of the arguments must match, so @code{(eql 3 3.0)} is
858still false.
859
860Note that Emacs integers are ``direct'' rather than allocated, which
861basically means @code{(eq 3 3)} will always be true. Thus @code{eq}
862and @code{eql} behave differently only if floating-point numbers are
863involved, and are indistinguishable on Emacs versions that don't
864support floats.
865
866There is a slight inconsistency with Common Lisp in the treatment of
867positive and negative zeros. Some machines, notably those with IEEE
868standard arithmetic, represent @code{+0} and @code{-0} as distinct
869values. Normally this doesn't matter because the standard specifies
870that @code{(= 0.0 -0.0)} should always be true, and this is indeed
871what Emacs Lisp and Common Lisp do. But the Common Lisp standard
872states that @code{(eql 0.0 -0.0)} and @code{(equal 0.0 -0.0)} should
873be false on IEEE-like machines; Emacs Lisp does not do this, and in
874fact the only known way to distinguish between the two zeros in Emacs
875Lisp is to @code{format} them and check for a minus sign.
876@end defun
877 844
878@defun equalp a b 845@defun equalp a b
879This function is a more flexible version of @code{equal}. In 846This function is a more flexible version of @code{equal}. In
@@ -3685,7 +3652,7 @@ the same sequence, in the same order as they appear in that sequence.)
3685The @code{:test} argument specifies a function which must return 3652The @code{:test} argument specifies a function which must return
3686true (non-@code{nil}) to indicate a match; instead, you may use 3653true (non-@code{nil}) to indicate a match; instead, you may use
3687@code{:test-not} to give a function which returns @emph{false} to 3654@code{:test-not} to give a function which returns @emph{false} to
3688indicate a match. The default test function is @code{:test 'eql}. 3655indicate a match. The default test function is @code{eql}.
3689 3656
3690Many functions which take @var{item} and @code{:test} or @code{:test-not} 3657Many functions which take @var{item} and @code{:test} or @code{:test-not}
3691arguments also come in @code{-if} and @code{-if-not} varieties, 3658arguments also come in @code{-if} and @code{-if-not} varieties,
@@ -4998,7 +4965,7 @@ which understand full-featured argument lists. The @code{&whole}
4998keyword does not work in @code{defmacro} argument lists (except 4965keyword does not work in @code{defmacro} argument lists (except
4999inside recursive argument lists). 4966inside recursive argument lists).
5000 4967
5001The @code{eql} and @code{equal} predicates do not distinguish 4968The @code{equal} predicate does not distinguish
5002between IEEE floating-point plus and minus zero. The @code{equalp} 4969between IEEE floating-point plus and minus zero. The @code{equalp}
5003predicate has several differences with Common Lisp; @pxref{Predicates}. 4970predicate has several differences with Common Lisp; @pxref{Predicates}.
5004 4971
@@ -5218,12 +5185,6 @@ whereas Emacs Lisp's parser just treats quote as a special case.
5218Some Lisp packages use reader macros to create special syntaxes 5185Some Lisp packages use reader macros to create special syntaxes
5219for themselves, which the Emacs parser is incapable of reading. 5186for themselves, which the Emacs parser is incapable of reading.
5220 5187
5221The lack of reader macros, incidentally, is the reason behind
5222Emacs Lisp's unusual backquote syntax. Since backquotes are
5223implemented as a Lisp package and not built-in to the Emacs
5224parser, they are forced to use a regular macro named @code{`}
5225which is used with the standard function/macro call notation.
5226
5227@item 5188@item
5228Other syntactic features. Common Lisp provides a number of 5189Other syntactic features. Common Lisp provides a number of
5229notations beginning with @code{#} that the Emacs Lisp parser 5190notations beginning with @code{#} that the Emacs Lisp parser
@@ -5287,11 +5248,11 @@ matters, Emacs has its own @code{#(} notation for
5287something entirely different---strings with properties. 5248something entirely different---strings with properties.
5288 5249
5289@item 5250@item
5290Characters are distinct from integers in Common Lisp. The 5251Characters are distinct from integers in Common Lisp. The notation
5291notation for character constants is also different: @code{#\A} 5252for character constants is also different: @code{#\A} in Common Lisp
5292instead of @code{?A}. Also, @code{string=} and @code{string-equal} 5253where Emacs Lisp uses @code{?A}. Also, @code{string=} and
5293are synonyms in Emacs Lisp whereas the latter is case-insensitive 5254@code{string-equal} are synonyms in Emacs Lisp, whereas the latter is
5294in Common Lisp. 5255case-insensitive in Common Lisp.
5295 5256
5296@item 5257@item
5297Data types. Some Common Lisp data types do not exist in Emacs 5258Data types. Some Common Lisp data types do not exist in Emacs