Skip to content

Commit

Permalink
Merge pull request #1389 from benneti/master
Browse files Browse the repository at this point in the history
document kwarg fold in substitute
  • Loading branch information
ChrisRackauckas authored Dec 17, 2024
2 parents ea836eb + 5854180 commit ab3fcd6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Symbolics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ include("rewrite-helpers.jl")
include("complex.jl")

"""
substitute(expr, s)
substitute(expr, s; fold=true)
Performs the substitution on `expr` according to rule(s) `s`.
If `fold=false`, expressions which can be evaluated won't be evaluated.
# Examples
```jldoctest
julia> @variables t x y z(t)
Expand All @@ -79,6 +80,8 @@ julia> ex = x + y + sin(z)
(x + y) + sin(z(t))
julia> substitute(ex, Dict([x => z, sin(z) => z^2]))
(z(t) + y) + (z(t) ^ 2)
julia> substitute(sqrt(2x), Dict([x => 1]); fold=false)
sqrt(2)
```
"""
substitute
Expand Down

0 comments on commit ab3fcd6

Please sign in to comment.