From: Paul Eggert Date: Mon, 2 Apr 2018 19:19:00 +0000 (-0700) Subject: Clarify eq on floats X-Git-Tag: emacs-27.0.90~5342 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=dfa922dd844c7af966a42b949aee32248ce4e8a2;p=emacs.git Clarify eq on floats * doc/lispref/objects.texi (Equality Predicates): Say that two floats with the same values might or might not be eq. --- diff --git a/doc/lispref/objects.texi b/doc/lispref/objects.texi index af740625adb..78a7dccc88d 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 @@ -2095,6 +2099,12 @@ be reflected by the same change in the contents of the other. @result{} t @end group +@group +(eq 3.0 3.0) + @result{} t @r{or} nil +;; @r{The result is implementation-dependent.} +@end group + @group (eq "asdf" "asdf") @result{} nil