Skip to content

Commit 6b01653

Browse files
committed
import symbolics
1 parent 1a007be commit 6b01653

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ModelingToolkitStandardLibrary.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module ModelingToolkitStandardLibrary
2+
import Symbolics: unwrap
23

34
"""
45
@symcheck J > 0 || throw(ArgumentError("Expected `J` to be positive"))
@@ -10,11 +11,11 @@ macro symcheck(ex)
1011
error("Expected an expresion on the form sym > val || error()")
1112
sym = ex.args[1].args[2]
1213
quote
14+
_issymbolic(x) = !(unwrap(x) isa Real)
1315
_issymbolic($(esc(sym))) || ($(esc(ex)))
1416
end
1517
end
1618

17-
_issymbolic(x) = !(Symbolics.unwrap(x) isa Real)
1819

1920
include("Blocks/Blocks.jl")
2021
include("Mechanical/Mechanical.jl")

0 commit comments

Comments
 (0)