# Broadcast macro @. "escape" from it

**URL:** <https://discourse.julialang.org/t/broadcast-macro-escape-from-it/94396>\
**Category:** New to Julia\
**Created:** [February 10, 2023, 8:30am UTC](https://discourse.julialang.org/t/broadcast-macro-escape-from-it/94396 "2023-02-10T08:30:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mreichMPI-BGC](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mreichmpi-bgc/32/43775_2.png) [@mreichMPI-BGC](https://discourse.julialang.org/u/mreichMPI-BGC)\
**Post date:** [February 10, 2023, 8:30am UTC](https://discourse.julialang.org/t/broadcast-macro-escape-from-it/94396/1 "2023-02-10T08:30:21Z")

</div>

Dear all,  
I like the @. macro, but is there a way to partly escape it? Use case is a situation where in an expression 9 out of 10 operations need the `.` and one operation does not.

```julia
@. sum(a + b + c + d)

```

where a to d are vectors and I want the sum of the sum them, so `sum` should not be broadcast.

I could imagine one just inverts the notation, i.e. `.` then means “do not broadcast, but that did not work”.  
Thanks!

---

<div class="post-metadata">

**Author:** ![fatteneder](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fatteneder/32/33991_2.png) [@fatteneder](https://discourse.julialang.org/u/fatteneder)\
**Post date:** [February 10, 2023, 10:12am UTC](https://discourse.julialang.org/t/broadcast-macro-escape-from-it/94396/2 "2023-02-10T10:12:41Z")

</div>

```julia
help?> @.
  @. expr

  Convert every function call or operator in expr into a "dot call" (e.g. convert f(x) to f.(x)), and convert every assignment in expr to a "dot assignment" (e.g. convert += to .+=).

  If you want to avoid adding dots for selected function calls in expr, splice those function calls in with $. For example, @. sqrt(abs($sort(x))) is equivalent to sqrt.(abs.(sort(x))) (no
  dot for sort).

  (@. is equivalent to a call to @ __dot__.)

  Examples
  ≡≡≡≡≡≡≡≡≡≡

  julia> x = 1.0:3.0; y = similar(x);
  
  julia> @. y = x + 3 * sin(x)
  3-element Vector{Float64}:
   3.5244129544236893
   4.727892280477045
   3.4233600241796016

```

So perhaps try

```julia
@. $sum(a + b + c + d)

```

---

<div class="post-metadata">

**Author:** ![mreichMPI-BGC](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mreichmpi-bgc/32/43775_2.png) [@mreichMPI-BGC](https://discourse.julialang.org/u/mreichMPI-BGC)\
**Post date:** [February 10, 2023, 10:17am UTC](https://discourse.julialang.org/t/broadcast-macro-escape-from-it/94396/3 "2023-02-10T10:17:43Z")

</div>

Thanks - should have read the help indeed 👼
