Skip to content
Prev 6069 / 63468 Next

Wierd problem comparing numeric values and list using == (PR#1076)

jmc@research.bell-labs.com writes:
....
Not really, except that I get the usual nagging suspicion that someone
(who?) meant something by doing it this way...

The current logic seems to be that if either side of the == is a
vector of atomic type, try to coerce the list on the other side to a
similar object and then test. However this has a clear bug in that the
coercion is to double even when the atomic vector is integer. If there
are lists on both sides, a pointer comparison is done:
[1] FALSE
[1] TRUE

The latter seems highly dubious to me. I'd rather have a recursive
pairwise application of "==" there. However, none of this is what
identical does, is it?