You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
julia> r =@rule a b log(a / b) -->log(a) -log(b)
julia>r(:(log(x / y)))
:(log(x) -log(y))
However I'm interested in matching broadcasted functions in expressions, but the following doesn't work:
julia> r =@rule a b log.(a./b) -->log.(a) -log.(b)
julia>r(:(log.(x./y)))
(nothing)
broadcasting binary operators does work
julia> r =@rule a b a .+ b --> b .+ a
julia>r(:(x .+ y))
:(y .+ x)
using the broadcast function doesn't work
julia> r =@rule a b broadcast(+, a, b) -->broadcast(+, b, a)
julia>r(:(broadcast(+, x, y)))
(nothing)
I briefly looked into TermInterface.jl, and am wondering if the fact that exprhead returns :. for some expressions and :call for others is the culprit.
The following works as expected
However I'm interested in matching broadcasted functions in expressions, but the following doesn't work:
broadcasting binary operators does work
using the broadcast function doesn't work
I briefly looked into TermInterface.jl, and am wondering if the fact that exprhead returns
:.
for some expressions and:call
for others is the culprit.The text was updated successfully, but these errors were encountered: