Skip to content

Commit

Permalink
boolean ops on functions [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanKarpinski committed Jun 28, 2016
1 parent dc8e1b5 commit 336dbfd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion base/operators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,12 @@ eltype(x) = eltype(typeof(x))
# function pipelining, composition & negation

|>(x, f) = f(x)

(f, g) = (x...)->f(g(x...))

!(f::Function) = (x...)->!f(x...)
|(f::Function, g::Function) = (x...)->f(x...) || g(x...)
(&)(f::Function, g::Function) = (x...)->f(x...) && g(x...)
($)(f::Function, g::Function) = (x...)->f(x...) $ g(x...)

# array shape rules

Expand Down

0 comments on commit 336dbfd

Please sign in to comment.