>From b89189f686a599817d8cdcc81038b62a38a7baa7 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 2 Apr 2018 12:19:00 -0700 Subject: [PATCH] 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 af740625ad..78a7dccc88 100644 --- a/doc/lispref/objects.texi +++ b/doc/lispref/objects.texi @@ -2083,6 +2083,10 @@ Equality Predicates 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 @@ Equality Predicates @result{} t @end group address@hidden +(eq 3.0 3.0) + @result{} t @r{or} nil +;; @r{The result is implementation-dependent.} address@hidden group + @group (eq "asdf" "asdf") @result{} nil -- 2.14.3