diff options
| author | Richard M. Stallman | 2007-11-15 11:55:59 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2007-11-15 11:55:59 +0000 |
| commit | 0a3333b5a69175bf284406e98a01a09b65f26b60 (patch) | |
| tree | 8f420e734e2baedeac84bcc0538d2f5d34dd68fb | |
| parent | 9ffb952120776aec512cabc9bb5af660f016bcac (diff) | |
| download | emacs-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.texi | 63 |
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}; | |||
| 287 | they do not cause other components like @file{cl-extra} to be loaded. | 287 | they do not cause other components like @file{cl-extra} to be loaded. |
| 288 | 288 | ||
| 289 | @example | 289 | @example |
| 290 | eql floatp-safe endp | 290 | floatp-safe endp |
| 291 | evenp oddp plusp minusp | 291 | evenp oddp plusp minusp |
| 292 | caaar .. cddddr | 292 | caaar .. cddddr |
| 293 | list* ldiff rest first .. tenth | 293 | list* 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 |
| 843 | This package defines two Common Lisp predicates, @code{eql} and | 843 | This package defines the Common Lisp predicate @code{equalp}. |
| 844 | @code{equalp}. | ||
| 845 | |||
| 846 | @defun eql a b | ||
| 847 | This function is almost the same as @code{eq}, except that if @var{a} | ||
| 848 | and @var{b} are numbers of the same type, it compares them for numeric | ||
| 849 | equality (as if by @code{equal} instead of @code{eq}). This makes a | ||
| 850 | difference only for versions of Emacs that are compiled with | ||
| 851 | floating-point support. Emacs floats are allocated | ||
| 852 | objects just like cons cells, which means that @code{(eq 3.0 3.0)} | ||
| 853 | will not necessarily be true---if the two @code{3.0}s were allocated | ||
| 854 | separately, the pointers will be different even though the numbers are | ||
| 855 | the same. But @code{(eql 3.0 3.0)} will always be true. | ||
| 856 | |||
| 857 | The types of the arguments must match, so @code{(eql 3 3.0)} is | ||
| 858 | still false. | ||
| 859 | |||
| 860 | Note that Emacs integers are ``direct'' rather than allocated, which | ||
| 861 | basically means @code{(eq 3 3)} will always be true. Thus @code{eq} | ||
| 862 | and @code{eql} behave differently only if floating-point numbers are | ||
| 863 | involved, and are indistinguishable on Emacs versions that don't | ||
| 864 | support floats. | ||
| 865 | |||
| 866 | There is a slight inconsistency with Common Lisp in the treatment of | ||
| 867 | positive and negative zeros. Some machines, notably those with IEEE | ||
| 868 | standard arithmetic, represent @code{+0} and @code{-0} as distinct | ||
| 869 | values. Normally this doesn't matter because the standard specifies | ||
| 870 | that @code{(= 0.0 -0.0)} should always be true, and this is indeed | ||
| 871 | what Emacs Lisp and Common Lisp do. But the Common Lisp standard | ||
| 872 | states that @code{(eql 0.0 -0.0)} and @code{(equal 0.0 -0.0)} should | ||
| 873 | be false on IEEE-like machines; Emacs Lisp does not do this, and in | ||
| 874 | fact the only known way to distinguish between the two zeros in Emacs | ||
| 875 | Lisp 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 |
| 879 | This function is a more flexible version of @code{equal}. In | 846 | This 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.) | |||
| 3685 | The @code{:test} argument specifies a function which must return | 3652 | The @code{:test} argument specifies a function which must return |
| 3686 | true (non-@code{nil}) to indicate a match; instead, you may use | 3653 | true (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 |
| 3688 | indicate a match. The default test function is @code{:test 'eql}. | 3655 | indicate a match. The default test function is @code{eql}. |
| 3689 | 3656 | ||
| 3690 | Many functions which take @var{item} and @code{:test} or @code{:test-not} | 3657 | Many functions which take @var{item} and @code{:test} or @code{:test-not} |
| 3691 | arguments also come in @code{-if} and @code{-if-not} varieties, | 3658 | arguments also come in @code{-if} and @code{-if-not} varieties, |
| @@ -4998,7 +4965,7 @@ which understand full-featured argument lists. The @code{&whole} | |||
| 4998 | keyword does not work in @code{defmacro} argument lists (except | 4965 | keyword does not work in @code{defmacro} argument lists (except |
| 4999 | inside recursive argument lists). | 4966 | inside recursive argument lists). |
| 5000 | 4967 | ||
| 5001 | The @code{eql} and @code{equal} predicates do not distinguish | 4968 | The @code{equal} predicate does not distinguish |
| 5002 | between IEEE floating-point plus and minus zero. The @code{equalp} | 4969 | between IEEE floating-point plus and minus zero. The @code{equalp} |
| 5003 | predicate has several differences with Common Lisp; @pxref{Predicates}. | 4970 | predicate 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. | |||
| 5218 | Some Lisp packages use reader macros to create special syntaxes | 5185 | Some Lisp packages use reader macros to create special syntaxes |
| 5219 | for themselves, which the Emacs parser is incapable of reading. | 5186 | for themselves, which the Emacs parser is incapable of reading. |
| 5220 | 5187 | ||
| 5221 | The lack of reader macros, incidentally, is the reason behind | ||
| 5222 | Emacs Lisp's unusual backquote syntax. Since backquotes are | ||
| 5223 | implemented as a Lisp package and not built-in to the Emacs | ||
| 5224 | parser, they are forced to use a regular macro named @code{`} | ||
| 5225 | which is used with the standard function/macro call notation. | ||
| 5226 | |||
| 5227 | @item | 5188 | @item |
| 5228 | Other syntactic features. Common Lisp provides a number of | 5189 | Other syntactic features. Common Lisp provides a number of |
| 5229 | notations beginning with @code{#} that the Emacs Lisp parser | 5190 | notations beginning with @code{#} that the Emacs Lisp parser |
| @@ -5287,11 +5248,11 @@ matters, Emacs has its own @code{#(} notation for | |||
| 5287 | something entirely different---strings with properties. | 5248 | something entirely different---strings with properties. |
| 5288 | 5249 | ||
| 5289 | @item | 5250 | @item |
| 5290 | Characters are distinct from integers in Common Lisp. The | 5251 | Characters are distinct from integers in Common Lisp. The notation |
| 5291 | notation for character constants is also different: @code{#\A} | 5252 | for character constants is also different: @code{#\A} in Common Lisp |
| 5292 | instead of @code{?A}. Also, @code{string=} and @code{string-equal} | 5253 | where Emacs Lisp uses @code{?A}. Also, @code{string=} and |
| 5293 | are synonyms in Emacs Lisp whereas the latter is case-insensitive | 5254 | @code{string-equal} are synonyms in Emacs Lisp, whereas the latter is |
| 5294 | in Common Lisp. | 5255 | case-insensitive in Common Lisp. |
| 5295 | 5256 | ||
| 5296 | @item | 5257 | @item |
| 5297 | Data types. Some Common Lisp data types do not exist in Emacs | 5258 | Data types. Some Common Lisp data types do not exist in Emacs |