# Piping and broadcasting

**URL:** <https://discourse.julialang.org/t/piping-and-broadcasting/77765>\
**Category:** Internals & Design\
**Created:** [March 11, 2022, 6:48pm UTC](https://discourse.julialang.org/t/piping-and-broadcasting/77765 "2022-03-11T18:48:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kumarbalachandran](https://avatars.discourse-cdn.com/v4/letter/k/9f8e36/32.png) [@kumarbalachandran](https://discourse.julialang.org/u/kumarbalachandran)\
**Post date:** [March 11, 2022, 6:48pm UTC](https://discourse.julialang.org/t/piping-and-broadcasting/77765/1 "2022-03-11T18:48:14Z")

</div>

I was trying the pipe symbol and I noticed a quirk that probably makes sense with the precedence rules but it leaves something to be desired in expressiveness:

```julia
julia> (1,2,3) .|> -
(-1, -2, -3)
julia> (1,2,3) .|> sin .|> -
(-0.8414709848078965, -0.9092974268256817, -0.1411200080598672)
julia> (1,2,3) .|> - .|> sin
ERROR: syntax: ".|>" is not a unary operator
Stacktrace:
 [1] top-level scope
   @ none:1

julia> ((1,2,3) .|> - ) .|> sin
(-0.8414709848078965, -0.9092974268256817, -0.1411200080598672)

```

I guess its because the result of a unary operation cannot be resolved when there is another operator that follows it. Is this something that needs attention or should the programmer just be aware of the anomalous behavior?

I feel that the parser should be able to handle this pairwise from the left, though.

Kumar

---

<div class="post-metadata">

**Author:** ![Sukera](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Sukera](https://discourse.julialang.org/u/Sukera)\
**Post date:** [March 11, 2022, 6:51pm UTC](https://discourse.julialang.org/t/piping-and-broadcasting/77765/2 "2022-03-11T18:51:39Z")

</div>

> [@kumarbalachandran](#):
>
> `(1,2,3) .|> - .|> sin`

You’re looking for this:

```julia
julia> (1,2,3) .|> (-) .|> sin
(-0.8414709848078965, -0.9092974268256817, -0.1411200080598672)

```

Since `-` is a binary operator, using it infix in a pipe in this way requires parentheses.
