Skip to content

Commit 5854180

Browse files
committed
document kwarg fold in substitute
1 parent ea836eb commit 5854180

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Symbolics.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,10 @@ include("rewrite-helpers.jl")
6464
include("complex.jl")
6565

6666
"""
67-
substitute(expr, s)
67+
substitute(expr, s; fold=true)
6868
6969
Performs the substitution on `expr` according to rule(s) `s`.
70+
If `fold=false`, expressions which can be evaluated won't be evaluated.
7071
# Examples
7172
```jldoctest
7273
julia> @variables t x y z(t)
@@ -79,6 +80,8 @@ julia> ex = x + y + sin(z)
7980
(x + y) + sin(z(t))
8081
julia> substitute(ex, Dict([x => z, sin(z) => z^2]))
8182
(z(t) + y) + (z(t) ^ 2)
83+
julia> substitute(sqrt(2x), Dict([x => 1]); fold=false)
84+
sqrt(2)
8285
```
8386
"""
8487
substitute

0 commit comments

Comments
 (0)