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
Copy file name to clipboardExpand all lines: docs/src/manual/representation.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ Performance of symbolic simplification depends on the datastructures used to rep
4
4
5
5
The most basic term representation simply holds a function call and stores the function and the arguments it is called with. This is done by the `Term` type in SymbolicUtils. Functions that aren't commutative or associative, such as `sin` or `hypot` are stored as `Term`s. Commutative and associative operations like `+`, `*`, and their supporting operations like `-`, `/` and `^`, when used on terms of type `<:Number`, stand to gain from the use of more efficient datastrucutres.
6
6
7
-
All term representations must support `operation` and `arguments` functions. And they must define `istree` to return `true` when called with an instance of the type. Generic term-manipulation programs such as the rule-based rewriter make use of this interface to inspect expressions. In this way, the interface wins back the generality lost by having a zoo of term representations instead of one. (see [interface](/interface/) section for more on this.)
7
+
All term representations must support `operation` and `arguments` functions. And they must define `iscall` and `isexpr` to return `true` when called with an instance of the type. Generic term-manipulation programs such as the rule-based rewriter make use of this interface to inspect expressions. In this way, the interface wins back the generality lost by having a zoo of term representations instead of one. (see [interface](/interface/) section for more on this.)
Copy file name to clipboardExpand all lines: src/rewriters.jl
+9-25Lines changed: 9 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -167,11 +167,7 @@ end
167
167
struct Walk{ord, C, F, threaded}
168
168
rw::C
169
169
thread_cutoff::Int
170
-
maketerm::F#XXX: for the 2.0 deprecation cycle, we actually store a function
171
-
# that behaves like `similarterm` here, we use `compatmaker` to wrap
172
-
# maketerm-like input to do this, with a warning if similarterm provided
173
-
# we need this workaround to deprecate because similarterm takes value
174
-
# but maketerm only knows the type.
170
+
maketerm::F
175
171
end
176
172
177
173
functioninstrument(x::Walk{ord, C,F,threaded}, f) where {ord,C,F,threaded}
@@ -183,25 +179,13 @@ end
183
179
184
180
using.Threads
185
181
186
-
functioncompatmaker(similarterm, maketerm)
187
-
#XXX: delete this and only use maketerm in a future release.
188
-
if similarterm isa Nothing
189
-
function (x, f, args, type=_promote_symtype(f, args); metadata)
190
-
maketerm(typeof(x), f, args, type, metadata)
191
-
end
192
-
else
193
-
Base.depwarn("Prewalk and Postwalk now take maketerm instead of similarterm keyword argument. similarterm(x, f, args, type; metadata) is now maketerm(typeof(x), f, args, type, metadata)", :similarterm)
0 commit comments