Skip to content

Commit

Permalink
import operators from Base instead of use Base. syntax (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
tkelman authored and dpsanders committed Jul 24, 2016
1 parent 1fbfd2d commit 7fbab5c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/separator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ macro constraint(ex::Expr)
Separator(ex)
end

function Base.show(io::IO, S::Separator)
import Base: show, , , !

function show(io::IO, S::Separator)
print(io, "Separator with variables ")
print(io, join(map(string, S.variables), ", "))
#print(io, " - variables: $(S.variables)")
Expand Down Expand Up @@ -95,7 +97,7 @@ Takes an iterator of intervals (`IntervalBox`, tuple, array, etc.), of length
equal to the total number of variables in `S1` and `S2`;
it returns inner and outer tuples of the same length
"""
function Base.(S1::Separator, S2::Separator)
function (S1::Separator, S2::Separator)

variables, indices1, indices2, where1, where2 = unify_variables(S1.variables, S2.variables)
numvars = length(variables)
Expand Down Expand Up @@ -143,7 +145,7 @@ function Base.∩(S1::Separator, S2::Separator)

end

function Base.(S1::Separator, S2::Separator)
function (S1::Separator, S2::Separator)

variables, indices1, indices2, where1, where2 = unify_variables(S1.variables, S2.variables)
numvars = length(variables)
Expand Down Expand Up @@ -188,7 +190,6 @@ function Base.∪(S1::Separator, S2::Separator)

end

import Base.!
function !(S::Separator)
f = X -> begin
inner, outer = S(X)
Expand Down

0 comments on commit 7fbab5c

Please sign in to comment.