Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import operators from Base instead of using Base. syntax #22

Merged
merged 1 commit into from
Jul 24, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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