Skip to content

Commit 5a3d76f

Browse files
committed
fix toexpr(::Num) and added Num(Sym{T}(::Symbol)) to macro-free example
1 parent 92f7798 commit 5a3d76f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/src/tutorials/symbolic_functions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,8 @@ the user's code. For these cases, ModelingToolkit.jl allows for fully
382382
macro-free usage. For example:
383383

384384
```julia
385-
x = Sym{Float64}(:x)
386-
y = Sym{Float64}(:y)
385+
x = Num(Sym{Float64}(:x))
386+
y = Num(Sym{Float64}(:y))
387387
x+y^2.0 # isa Num
388388
```
389389

@@ -395,7 +395,7 @@ If we need to use this to generate new Julia code, we can simply
395395
convert the output to an `Expr`:
396396

397397
```julia
398-
Expr(x+y^2)
398+
toexpr(x+y^2)
399399
```
400400

401401
## `Sym`s and callable `Sym`s

0 commit comments

Comments
 (0)