Skip to content

Commit 125711f

Browse files
committed
compat fixes
1 parent 2a8a8c6 commit 125711f

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

REQUIRE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
julia 0.3
1+
julia 0.3.7
22
Compat

src/differentiate.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,11 @@ export symbolic_derivatives_1arg
195195

196196
# deprecated: for backward compatibility with packages that used
197197
# this unexported interface.
198-
derivative_rules = Array((Symbol,Expr),0)
198+
if VERSION < v"0.4.0-dev+4319"
199+
derivative_rules = Array((Symbol,Expr),0)
200+
else
201+
derivative_rules = Array(Tuple{Symbol,Expr},0)
202+
end
199203
for (s,ex) in symbolic_derivative_1arg_list
200204
push!(derivative_rules, (s, :(xp*$ex)))
201205
end

src/symbolic.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ function simplify(::SymbolParameter{:+}, args)
140140
return args[1]
141141
else
142142
(sum, sym_args) = sum_numeric_args(args)
143-
args = sum==0 ? sym_args : [sum, sym_args]
143+
args = sum==0 ? sym_args : [sum; sym_args]
144144
return Expr(:call, :+, args...)
145145
end
146146
end
@@ -182,7 +182,7 @@ function simplify(::SymbolParameter{:*}, args)
182182
return Expr(:call, :-, args[2])
183183
else
184184
(prod, sym_args) = mul_numeric_args(args)
185-
args = prod==1 ? sym_args : [prod, sym_args]
185+
args = prod==1 ? sym_args : [prod; sym_args]
186186
return Expr(:call, :*, args...)
187187
end
188188
end

test/symbolic.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,5 +96,5 @@ end
9696
# Tests with ifelse
9797
#
9898
@test isequal(differentiate(:(ifelse(x < 1, exp(x^2), 1/x)), :x), :(ifelse(x < 1,2x * exp(x^2), -1/x^2)))
99-
@test isequal(differentiate(:(ifelse(x <= 0, 0, ifelse(x > 1, 1, x))), : x),
99+
@test isequal(differentiate(:(ifelse(x <= 0, 0, ifelse(x > 1, 1, x))), :x),
100100
:(ifelse(x <= 0, 0, ifelse(x > 1, 0, 1))))

0 commit comments

Comments
 (0)