JuliaSymbolics / Symbolics.jl

Symbolic programming for the next generation of numerical software
https://symbolics.juliasymbolics.org/stable/
Other
1.32k stars 146 forks source link

Errors when defining certain rules #1170

Closed dpsanders closed 2 weeks ago

dpsanders commented 2 weeks ago
julia> @rule ~x ^ ~y => 0
ERROR: LoadError: Syntax for specifying a slot is ~x::$predicate, where predicate is a boolean function
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:35
 [2] makeslot(s::Expr, keys::Vector{Symbol})
   @ SymbolicUtils ~/.julia/packages/SymbolicUtils/qyMYa/src/rule.jl:49
 [3] makepattern(expr::Expr, keys::Vector{Symbol})
   @ SymbolicUtils ~/.julia/packages/SymbolicUtils/qyMYa/src/rule.jl:67
 [4] var"@rule"(__source__::LineNumberNode, __module__::Module, expr::Any)
   @ SymbolicUtils ~/.julia/packages/SymbolicUtils/qyMYa/src/rule.jl:306
in expression starting at REPL[4]:1
dpsanders commented 2 weeks ago

Ah seems like that needs to be

julia> @rule (~x) ^ (~y) => 0