RCall.jl icon indicating copy to clipboard operation
RCall.jl copied to clipboard

equal `==` is not working on `reval`

Open schlichtanders opened this issue 2 years ago • 2 comments

julia> reval("1") == reval("1")
false

I am wondering whether this is intended. Of course there is rcopy, but I thought comparison would work on the RObjects as well.

schlichtanders avatar Nov 21 '23 16:11 schlichtanders

I don't think there is a == method defined, so it falls back to ===:

julia> @code_lowered reval("1") == reval("1")
CodeInfo(
1 ─ %1 = x === y
└──      return %1
)

and these are indeed two different Julia objects even if they point to the same R object.

palday avatar Nov 22 '23 18:11 palday

That makes sense, thank you for the inspection.

schlichtanders avatar Nov 22 '23 19:11 schlichtanders