diff --git a/src/operators.jl b/src/operators.jl index 4cd37d67..de112104 100644 --- a/src/operators.jl +++ b/src/operators.jl @@ -1,7 +1,8 @@ -import Base: +, -, *, /, ^ +import Base: +, -, *, /, ^, == +(x::RObject, y::RObject) = rcall(Symbol("+"), x, y) -(x::RObject, y::RObject) = rcall(Symbol("-"), x, y) *(x::RObject, y::RObject) = rcall(Symbol("*"), x, y) /(x::RObject, y::RObject) = rcall(Symbol("/"), x, y) ^(x::RObject, y::RObject) = rcall(Symbol("^"), x, y) +==(x::RObject, y::RObject) = rcall(Symbol("=="), x, y) diff --git a/test/basic.jl b/test/basic.jl index 2ef28d61..da4d48fc 100644 --- a/test/basic.jl +++ b/test/basic.jl @@ -146,6 +146,7 @@ b = reval("b=c(4,5,6)") @test rcopy(a*b)==rcopy(R"a*b") @test rcopy(a/b)==rcopy(R"a/b") @test rcopy(a^b)==rcopy(R"a^b") +@test rcopy(a == b) == rcopy(R"a == b") # misc iris = rcopy(reval(:iris))