Skip to content

Commit 1f6e15e

Browse files
committed
fixes
1 parent 9ccbb11 commit 1f6e15e

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/methods.jl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const diadic = [+, -, max, min, *, /, \, hypot, atan, mod, rem, ^]
44

55
const previously_declared_for = []
66
# TODO: keep domains tighter than this
7-
function eval_number_methods(T, rhs1, rhs2)
7+
function number_methods(T, rhs1, rhs2)
88
exprs = []
99
for f in diadic
1010
for S in previously_declared_for
@@ -15,6 +15,7 @@ function eval_number_methods(T, rhs1, rhs2)
1515
end
1616

1717
expr = quote
18+
(f::$(typeof(f)))(a::$T, b::$T) = $rhs2
1819
(f::$(typeof(f)))(a::$T, b::Real) = $rhs2
1920
(f::$(typeof(f)))(a::Real, b::$T) = $rhs2
2021
(f::$(typeof(f)))(a::$T, b::Number) = $rhs2
@@ -32,12 +33,12 @@ function eval_number_methods(T, rhs1, rhs2)
3233
end
3334

3435

35-
macro eval_number_methods(T, rhs1, rhs2)
36-
eval_number_methods(T, rhs1, rhs2)
36+
macro number_methods(T, rhs1, rhs2)
37+
number_methods(T, rhs1, rhs2)
3738
end
3839

39-
@eval_number_methods(Sym, term(f, a), term(f, a, b))
40-
@eval_number_methods(Term, term(f, a), term(f, a, b))
40+
@number_methods(Sym, term(f, a), term(f, a, b))
41+
@number_methods(Term, term(f, a), term(f, a, b))
4142

4243
for f in diadic
4344
@eval promote_symtype(::$(typeof(f)),

0 commit comments

Comments
 (0)