Skip to content

Commit ba198f5

Browse files
committed
don't export dot operators
1 parent d69fe58 commit ba198f5

File tree

2 files changed

+14
-36
lines changed

2 files changed

+14
-36
lines changed

base/exports.jl

-17
Original file line numberDiff line numberDiff line change
@@ -212,23 +212,6 @@ export
212212
*,
213213
+,
214214
-,
215-
.!=,
216-
.≠,
217-
.+,
218-
.-,
219-
.*,
220-
./,
221-
,
222-
.%,
223-
.<,
224-
.<=,
225-
.≤,
226-
.==,
227-
.>,
228-
.>=,
229-
.≥,
230-
.\,
231-
.^,
232215
/,
233216
//,
234217
.//,

test/broadcast.jl

+14-19
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ function as_sub{T}(x::AbstractArray{T,3})
8383
y
8484
end
8585

86-
bittest(f::Function, ewf::Function, a...) = (@test ewf(a...) == BitArray(broadcast(f, a...)))
86+
bittest(f::Function, a...) = (@test f.(a...) == BitArray(broadcast(f, a...)))
8787
n1 = 21
8888
n2 = 32
8989
n3 = 17
@@ -97,7 +97,7 @@ for arr in (identity, as_sub)
9797
@test broadcast(+, arr([1, 0]), arr([1, 4])) == [2, 4]
9898
@test broadcast(+, arr([1, 0]), 2) == [3, 2]
9999

100-
@test @inferred(arr(eye(2)) .+ arr([1, 4])) == arr([2 1; 4 5])
100+
@test @inferred(broadcast(+, arr(eye(2)), arr([1, 4]))) == arr([2 1; 4 5])
101101
@test arr(eye(2)) .+ arr([1 4]) == arr([2 4; 1 5])
102102
@test arr([1 0]) .+ arr([1, 4]) == arr([2 1; 5 4])
103103
@test arr([1, 0]) .+ arr([1 4]) == arr([2 5; 1 4])
@@ -137,19 +137,16 @@ for arr in (identity, as_sub)
137137
@test A == diagm(10:12)
138138
@test_throws BoundsError broadcast_setindex!(A, 7, [1,-1], [1 2])
139139

140-
for (f, ewf) in (((==), (.==)),
141-
((<) , (.<) ),
142-
((!=), (.!=)),
143-
((<=), (.<=)))
144-
bittest(f, ewf, arr(eye(2)), arr([1, 4]))
145-
bittest(f, ewf, arr(eye(2)), arr([1 4]))
146-
bittest(f, ewf, arr([0, 1]), arr([1 4]))
147-
bittest(f, ewf, arr([0 1]), arr([1, 4]))
148-
bittest(f, ewf, arr([1, 0]), arr([1, 4]))
149-
bittest(f, ewf, arr(rand(rb, n1, n2, n3)), arr(rand(rb, n1, n2, n3)))
150-
bittest(f, ewf, arr(rand(rb, 1, n2, n3)), arr(rand(rb, n1, 1, n3)))
151-
bittest(f, ewf, arr(rand(rb, 1, n2, 1)), arr(rand(rb, n1, 1, n3)))
152-
bittest(f, ewf, arr(bitrand(n1, n2, n3)), arr(bitrand(n1, n2, n3)))
140+
for f in ((==), (<) , (!=), (<=))
141+
bittest(f, arr(eye(2)), arr([1, 4]))
142+
bittest(f, arr(eye(2)), arr([1 4]))
143+
bittest(f, arr([0, 1]), arr([1 4]))
144+
bittest(f, arr([0 1]), arr([1, 4]))
145+
bittest(f, arr([1, 0]), arr([1, 4]))
146+
bittest(f, arr(rand(rb, n1, n2, n3)), arr(rand(rb, n1, n2, n3)))
147+
bittest(f, arr(rand(rb, 1, n2, n3)), arr(rand(rb, n1, 1, n3)))
148+
bittest(f, arr(rand(rb, 1, n2, 1)), arr(rand(rb, n1, 1, n3)))
149+
bittest(f, arr(bitrand(n1, n2, n3)), arr(bitrand(n1, n2, n3)))
153150
end
154151
end
155152

@@ -163,10 +160,8 @@ m = [1:2;]'
163160
@test m./r2 [ratio 2ratio]
164161
@test m./[r2;] [ratio 2ratio]
165162

166-
@test @inferred([0,1.2].+reshape([0,-2],1,1,2)) == reshape([0 -2; 1.2 -0.8],2,1,2)
167-
rt = Base.return_types(.+, Tuple{Array{Float64, 3}, Array{Int, 1}})
168-
@test length(rt) == 1 && rt[1] == Array{Float64, 3}
169-
rt = Base.return_types(broadcast, Tuple{typeof(.+), Array{Float64, 3}, Array{Int, 3}})
163+
@test @inferred(broadcast(+,[0,1.2],reshape([0,-2],1,1,2))) == reshape([0 -2; 1.2 -0.8],2,1,2)
164+
rt = Base.return_types(broadcast, Tuple{typeof(+), Array{Float64, 3}, Array{Int, 1}})
170165
@test length(rt) == 1 && rt[1] == Array{Float64, 3}
171166
rt = Base.return_types(broadcast!, Tuple{Function, Array{Float64, 3}, Array{Float64, 3}, Array{Int, 1}})
172167
@test length(rt) == 1 && rt[1] == Array{Float64, 3}

0 commit comments

Comments
 (0)