Skip to content

Commit ebe7ab5

Browse files
boolean ops on functions [ci skip]
1 parent dc8e1b5 commit ebe7ab5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

base/operators.jl

+3-1
Original file line numberDiff line numberDiff line change
@@ -331,10 +331,12 @@ eltype(x) = eltype(typeof(x))
331331
# function pipelining, composition & negation
332332

333333
|>(x, f) = f(x)
334-
335334
(f, g) = (x...)->f(g(x...))
336335

337336
!(f::Function) = (x...)->!f(x...)
337+
^(f::Function, g::Function) = (x...)->f(x...) ^ g(x...)
338+
|(f::Function, g::Function) = (x...)->f(x...) || g(x...)
339+
(&)(f::Function, g::Function) = (x...)->f(x...) && g(x...)
338340

339341
# array shape rules
340342

0 commit comments

Comments
 (0)