comparison man/cl.texi @ 259:11cf20601dec r20-5b28

Import from CVS: tag r20-5b28
author cvs
date Mon, 13 Aug 2007 10:23:02 +0200
parents 65c19d2020f7
children 6330739388db
comparison
equal deleted inserted replaced
258:58424f6abf56 259:11cf20601dec
939 Lisp is to @code{format} them and check for a minus sign. 939 Lisp is to @code{format} them and check for a minus sign.
940 @end defun 940 @end defun
941 941
942 @defun equalp a b 942 @defun equalp a b
943 This function is a more flexible version of @code{equal}. In 943 This function is a more flexible version of @code{equal}. In
944 particular, it compares strings case-insensitively, and it compares 944 particular, it compares strings and characters case-insensitively, and
945 numbers without regard to type (so that @code{(equalp 3 3.0)} is 945 it compares numbers without regard to type (so that @code{(equalp 3
946 true). Vectors and conses are compared recursively. All other 946 3.0)} is true). Vectors and conses are compared recursively. All other
947 objects are compared as if by @code{equal}. 947 objects are compared as if by @code{equal}.
948 948
949 This function differs from Common Lisp @code{equalp} in several 949 This function differs from Common Lisp @code{equalp} in several
950 respects. First, Common Lisp's @code{equalp} also compares 950 respects. First, in keeping with the idea that strings are less
951 @emph{characters} case-insensitively, which would be impractical 951 vector-like in Emacs Lisp, this package's @code{equalp} also will not
952 in this package since Emacs does not distinguish between integers 952 compare strings against vectors of integers. Second, Common Lisp's
953 and characters. In keeping with the idea that strings are less 953 @code{equalp} compares hash tables without regard to ordering, whereas
954 vector-like in Emacs Lisp, this package's @code{equalp} also will 954 this package simply compares hash tables in terms of their underlying
955 not compare strings against vectors of integers. Finally, Common 955 structure (which means vectors for Lucid Emacs 19 hash tables, or lists
956 Lisp's @code{equalp} compares hash tables without regard to 956 for other hash tables).
957 ordering, whereas this package simply compares hash tables in
958 terms of their underlying structure (which means vectors for Lucid
959 Emacs 19 hash tables, or lists for other hash tables).
960 @end defun 957 @end defun
961 958
962 Also note that the Common Lisp functions @code{member} and @code{assoc} 959 Also note that the Common Lisp functions @code{member} and @code{assoc}
963 use @code{eql} to compare elements, whereas Emacs Lisp follows the 960 use @code{eql} to compare elements, whereas Emacs Lisp follows the
964 MacLisp tradition and uses @code{equal} for these two functions. 961 MacLisp tradition and uses @code{equal} for these two functions.
3411 This variable holds the counter used to generate @code{gensym} names. 3408 This variable holds the counter used to generate @code{gensym} names.
3412 It is incremented after each use by @code{gensym}. In Common Lisp 3409 It is incremented after each use by @code{gensym}. In Common Lisp
3413 this is initialized with 0, but this package initializes it with a 3410 this is initialized with 0, but this package initializes it with a
3414 random (time-dependent) value to avoid trouble when two files that 3411 random (time-dependent) value to avoid trouble when two files that
3415 each used @code{gensym} in their compilation are loaded together. 3412 each used @code{gensym} in their compilation are loaded together.
3416 (Uninterned symbols become interned when the compiler writes them 3413
3417 out to a file and the Emacs loader loads them, so their names have to 3414 @strong{XEmacs note:} As of XEmacs 20.5, an uninterned symbol remains
3418 be treated a bit more carefully than in Common Lisp where uninterned 3415 uninterned even after being dumped to bytecode. Older versions of Emacs
3419 symbols remain uninterned after loading.) 3416 didn't distinguish the printed representation of interned and uninterned
3417 symbols, so their names had to be treated more carefully.
3420 @end defvar 3418 @end defvar
3421 3419
3422 @defun gentemp &optional x 3420 @defun gentemp &optional x
3423 This function is like @code{gensym}, except that it produces a new 3421 This function is like @code{gensym}, except that it produces a new
3424 @emph{interned} symbol. If the symbol that is generated already 3422 @emph{interned} symbol. If the symbol that is generated already