[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master dfa922d: Clarify eq on floats
From: |
Paul Eggert |
Subject: |
[Emacs-diffs] master dfa922d: Clarify eq on floats |
Date: |
Mon, 2 Apr 2018 15:19:39 -0400 (EDT) |
branch: master
commit dfa922dd844c7af966a42b949aee32248ce4e8a2
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>
Clarify eq on floats
* doc/lispref/objects.texi (Equality Predicates):
Say that two floats with the same values might or might not be eq.
---
doc/lispref/objects.texi | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/doc/lispref/objects.texi b/doc/lispref/objects.texi
index af74062..78a7dcc 100644
--- a/doc/lispref/objects.texi
+++ b/doc/lispref/objects.texi
@@ -2083,6 +2083,10 @@ 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, meaning that a change in the contents of one will
be reflected by the same change in the contents of the other.
+For other types of objects whose contents cannot be changed (e.g.,
+floats), two arguments with the same contents might or might not be
+the same object, and @code{eq} returns @code{t} or @code{nil}
+depending on whether the Lisp interpreter created one object or two.
@example
@group
@@ -2096,6 +2100,12 @@ be reflected by the same change in the contents of the
other.
@end group
@group
+(eq 3.0 3.0)
+ @result{} t @r{or} nil
+;; @r{The result is implementation-dependent.}
address@hidden group
+
address@hidden
(eq "asdf" "asdf")
@result{} nil
@end group
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master dfa922d: Clarify eq on floats,
Paul Eggert <=