Mercurial > hg > xemacs-beta
changeset 4471:2d39535e1f9d
Say explicitly that eq is useful for chars; xref number comparison, lispref
2008-05-27 Aidan Kehoe <kehoea@parhasard.net>
* lispref/objects.texi (Equality Predicates):
Cross reference to the section on comparison of numbers when
talking about using #'eq with integers; also mention that
#'eq gives t when passed identical integers, and that #'char= is
also available there.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Tue, 27 May 2008 11:58:42 +0200 |
parents | c76b1bc6bd28 |
children | a99eb40f0b5b |
files | man/ChangeLog man/lispref/objects.texi |
diffstat | 2 files changed, 24 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/man/ChangeLog Tue May 27 12:01:29 2008 +0200 +++ b/man/ChangeLog Tue May 27 11:58:42 2008 +0200 @@ -1,3 +1,11 @@ +2008-05-27 Aidan Kehoe <kehoea@parhasard.net> + + * lispref/objects.texi (Equality Predicates): + Cross reference to the section on comparison of numbers when + talking about using #'eq with integers; also mention that + #'eq gives t when passed identical integers, and that #'char= is + also available there. + 2008-05-21 Aidan Kehoe <kehoea@parhasard.net> * internals/internals.texi (Ben's README):
--- a/man/lispref/objects.texi Tue May 27 12:01:29 2008 +0200 +++ b/man/lispref/objects.texi Tue May 27 11:58:42 2008 +0200 @@ -2246,12 +2246,17 @@ change in one will be reflected by the same change in the other. @code{eq} returns @code{t} if @var{object1} and @var{object2} are -integers with the same value. Also, since symbol names are normally -unique, if the arguments are symbols with the same name, they are -@code{eq}. For other types (e.g., lists, vectors, strings), two -arguments with the same contents or elements are not necessarily -@code{eq} to each other: they are @code{eq} only if they are the same -object. +integers with the same value. It is preferable to use @code{=} or +@code{eql} in many contexts for numeric comparison; @pxref{Comparison of +Numbers}. @code{eq} also returns @code{t} if @var{object1} and +@var{object2} are identical characters, though in this case you may +prefer to use @code{char=}. + +Also, since symbol names are normally unique, if the arguments are +symbols with the same name, they are @code{eq}. For other types (e.g., +lists, vectors, strings), two arguments with the same contents or +elements are not necessarily @code{eq} to each other: they are @code{eq} +only if they are the same object. (The @code{make-symbol} function returns an uninterned symbol that is not interned in the standard @code{obarray}. When uninterned symbols @@ -2259,11 +2264,11 @@ the same name are not @code{eq}. @xref{Creating Symbols}.) NOTE: Under XEmacs 19, characters are really just integers, and thus -characters and integers are @code{eq}. Under XEmacs 20, it was -necessary to preserve remnants of this in function such as @code{old-eq} -in order to maintain byte-code compatibility. Byte code compiled -under any Emacs 19 will automatically have calls to @code{eq} mapped -to @code{old-eq} when executed under XEmacs 20. +characters and integers with the same numeric are @code{eq}. Under +XEmacs 20, it was necessary to preserve remnants of this in function +such as @code{old-eq} in order to maintain byte-code compatibility. +Byte code compiled under any Emacs 19 will automatically have calls to +@code{eq} mapped to @code{old-eq} when executed under XEmacs 20. @example @group