Changeset 4220 for trunk/man/cl.texi
- Timestamp:
- 04/04/08 22:04:40 (8 months ago)
- Files:
-
- trunk/man/cl.texi (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/man/cl.texi
r4204 r4220 6 6 This file documents the GNU Emacs Common Lisp emulation package. 7 7 8 Copyright @copyright{} 1993, 2001, 2002, 2003, 2004, 2005, 2006, 2007 8 Copyright @copyright{} 1993, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 9 9 Free Software Foundation, Inc. 10 10 … … 63 63 * Overview:: Installation, usage, etc. 64 64 * Program Structure:: Arglists, `eval-when', `defalias' 65 * Predicates:: `typep' , `eql',and `equalp'65 * Predicates:: `typep' and `equalp' 66 66 * Control Structure:: `setf', `do', `loop', etc. 67 67 * Macros:: Destructuring, `define-compiler-macro' … … 70 70 * Numbers:: Predicates, functions, random numbers 71 71 * Sequences:: Mapping, functions, searching, sorting 72 * Lists:: `cad r', `sublis', `member*', `assoc*', etc.72 * Lists:: `caddr', `sublis', `member*', `assoc*', etc. 73 73 * Structures:: `defstruct' 74 74 * Assertions:: `check-type', `assert', `ignore-errors'. … … 288 288 289 289 @example 290 eqlfloatp-safe endp290 floatp-safe endp 291 291 evenp oddp plusp minusp 292 292 caaar .. cddddr … … 701 701 @menu 702 702 * Type Predicates:: `typep', `deftype', and `coerce' 703 * Equality Predicates:: `eq l' and `equalp'703 * Equality Predicates:: `equalp' 704 704 @end menu 705 705 … … 841 841 842 842 @noindent 843 This package defines two Common Lisp predicates, @code{eql} and 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 843 This package defines the Common Lisp predicate @code{equalp}. 877 844 878 845 @defun equalp a b … … 2505 2472 @item for @var{var} being the key-codes of @var{keymap} 2506 2473 This clause iterates over the entries in @var{keymap}. 2507 The iteration does not enter nested keymaps or inherited (parent) keymaps. 2474 The iteration does not enter nested keymaps but does enter inherited 2475 (parent) keymaps. 2508 2476 You can use @samp{the key-bindings} to access the commands bound to 2509 2477 the keys rather than the key codes, and you can add a @code{using} … … 3686 3654 true (non-@code{nil}) to indicate a match; instead, you may use 3687 3655 @code{:test-not} to give a function which returns @emph{false} to 3688 indicate a match. The default test function is @code{ :test 'eql}.3656 indicate a match. The default test function is @code{eql}. 3689 3657 3690 3658 Many functions which take @var{item} and @code{:test} or @code{:test-not} … … 4999 4967 inside recursive argument lists). 5000 4968 5001 The @code{eq l} and @code{equal} predicates donot distinguish4969 The @code{equal} predicate does not distinguish 5002 4970 between IEEE floating-point plus and minus zero. The @code{equalp} 5003 4971 predicate has several differences with Common Lisp; @pxref{Predicates}. … … 5218 5186 Some Lisp packages use reader macros to create special syntaxes 5219 5187 for themselves, which the Emacs parser is incapable of reading. 5220 5221 The lack of reader macros, incidentally, is the reason behind5222 Emacs Lisp's unusual backquote syntax. Since backquotes are5223 implemented as a Lisp package and not built-in to the Emacs5224 parser, they are forced to use a regular macro named @code{`}5225 which is used with the standard function/macro call notation.5226 5188 5227 5189 @item … … 5288 5250 5289 5251 @item 5290 Characters are distinct from integers in Common Lisp. The 5291 notation for character constants is also different: @code{#\A} 5292 instead of @code{?A}. Also, @code{string=} and @code{string-equal} 5293 are synonyms in Emacs Lisp whereas the latter is case-insensitive 5294 in Common Lisp.5252 Characters are distinct from integers in Common Lisp. The notation 5253 for character constants is also different: @code{#\A} in Common Lisp 5254 where Emacs Lisp uses @code{?A}. Also, @code{string=} and 5255 @code{string-equal} are synonyms in Emacs Lisp, whereas the latter is 5256 case-insensitive in Common Lisp. 5295 5257 5296 5258 @item
