JuliaInterop / RCall.jl

Call R from Julia
Other
319 stars 59 forks source link

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

Open schlichtanders opened 10 months ago

schlichtanders commented 10 months ago
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.

palday commented 10 months ago

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.

schlichtanders commented 10 months ago

That makes sense, thank you for the inspection.