Skip to content

Commit f6d592c

Browse files
authored
Merge pull request #243 from JuliaSymbolics/s/symfyy
Look up everything in symbolify
2 parents cc7e77b + 3024b1e commit f6d592c

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "SymbolicUtils"
22
uuid = "d1185830-fcd6-423d-90d6-eec64667417b"
33
authors = ["Shashi Gowda"]
4-
version = "0.9.2"
4+
version = "0.9.3"
55

66
[deps]
77
AbstractAlgebra = "c3fe647b-3220-5bb0-a1ea-a7954cac585d"

src/code.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ function toexpr(O, st)
125125
if expr′ !== nothing
126126
return expr′
127127
else
128+
haskey(st.symbolify, O) && return st.symbolify[O]
128129
args = arguments(O)
129130
return Expr(:call, toexpr(op, st), map(x->toexpr(x, st), args)...)
130131
end

test/code.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,5 +132,13 @@ test_repr(a, b) = @test repr(Base.remove_linenums!(a)) == repr(Base.remove_linen
132132
[(),
133133
(0.6,)],
134134
vcat)|>toexpr|>eval) < 1.1
135+
136+
let
137+
@syms a b
138+
139+
f = eval(toexpr(Func([a+b], [], a+b)))
140+
@test f(1) == 1
141+
@test f(2) == 2
142+
end
135143
end
136144

0 commit comments

Comments
 (0)