Skip to content

Commit 21aab4f

Browse files
committed
docs: improve extended examples
1 parent 9bfeb6e commit 21aab4f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

test/test_expressions.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,10 @@ end
358358
xs = [Expression(Node{Float64}(; feature=i); operators, variable_names) for i in 1:5]
359359

360360
xs[1] + xs[2]
361+
# These have the same type – they simply combine their `AbstractExpressionNode` objects
362+
# and ensure the metadata is the same.
363+
typeof(xs[1] + xs[2])
364+
361365
#=
362366
This gives us an easy way to quickly construct expressions with minimal memory overhead,
363367
and fast evaluation speed:

test/test_structured_expression.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ end
114114
This is a composite `AbstractExpression` object that composes multiple
115115
expressions during evaluation.
116116
=#
117-
ex = StructuredExpression((; f, g), nt -> nt.f + nt.g)
117+
ex = StructuredExpression((; f, g), nt -> nt.f + nt.g; operators, variable_names)
118118
ex
119119
@test typeof(ex) <: AbstractExpression{Float64,<:Node{Float64}} #src
120120
#=

0 commit comments

Comments
 (0)