You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've run into some strange behavior while trying to define |> as a pipe operator. Yes, yes, I know that | works perfectly well, but |> is more pleasing to my eye, so bear with me. 😇
julia>double(x) = x*2
julia>|>(val, f) =f(val)
julia>5|> double
10
julia> (5|> double
|> double)
ERROR: type: non-boolean (Int64) used in boolean context
# Both parse as a :comparison
julia> :(5|> double).head
:comparison
julia> :(5|> double |> double).head
:comparison
Perhaps neither of these should be possible and both should be a type error, but this outcome seems unlikely to be intended.
The text was updated successfully, but these errors were encountered:
I've run into some strange behavior while trying to define
|>
as a pipe operator. Yes, yes, I know that|
works perfectly well, but|>
is more pleasing to my eye, so bear with me. 😇Perhaps neither of these should be possible and both should be a type error, but this outcome seems unlikely to be intended.
The text was updated successfully, but these errors were encountered: