JuliaSymbolics / SymbolicUtils.jl

Symbolic expressions, rewriting and simplification
https://docs.sciml.ai/SymbolicUtils/stable/
Other
536 stars 107 forks source link

Rule macro quotes function names #394

Closed willow-ahrens closed 2 years ago

willow-ahrens commented 2 years ago

The rule macro was changed to quote the names of functions in function call expressions. This is a change from the old rule macro. I used to return function objects from the operation function, and now all my code is broken.

willow-ahrens commented 2 years ago

This was not a backward-compatible change. I believe the following code should return true:

struct qux
       args
       qux(args...) = new(args)
end
TermInterface.operation(qux) = qux
TermInterface.istree(qux) = true
TermInterface.arguments(qux) = [qux.args...]
@capture qux(1, 2) qux(1, 2)
willow-ahrens commented 2 years ago

I think this should be filed on MetaTheory

willow-ahrens commented 2 years ago

I'll reopen this and let someone else decide where this should be filed. I also filed this issue with Metatheory

shashi commented 2 years ago

You're right. The relevant code is now in MT.

willow-ahrens commented 1 year ago

https://github.com/JuliaSymbolics/Metatheory.jl/issues/87