# Equivalent of Ref in a @. — $Ref?

**URL:** https://discourse.julialang.org/t/equivalent-of-ref-in-a-ref/20478
**Category:** General Usage
**Tags:** question, broadcasting
**Created:** [February 5, 2019, 4:30pm UTC](https://discourse.julialang.org/t/equivalent-of-ref-in-a-ref/20478 "2019-02-05T16:30:56Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [February 5, 2019, 4:30pm UTC](https://discourse.julialang.org/t/equivalent-of-ref-in-a-ref/20478/1 "2019-02-05T16:30:56Z")

</div>

If I want to simplify a broadcasted call full of `.`s with `@.`, what is the recommended way of ensuring that certain values are treated as scalars? Eg should I replace `Ref` with `$Ref`? MWE:

```julia
# setup
a, b = 1, 2
cs = collect(1:10)
f(a, b, c) = a + b + c

# original
cs .= f.(Ref(a), Ref(b), cs)

# @ __dot__ , is $Ref the simplest way?
@. cs = f($Ref(a), $Ref(b), cs)

```

---

<div class="post-metadata">

### Author: ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)
#### Post date: [February 5, 2019, 6:19pm UTC](https://discourse.julialang.org/t/equivalent-of-ref-in-a-ref/20478/2 "2019-02-05T18:19:38Z")

</div>

Just cross-referencing some previous discussion on this topic: [recent broadcast changes (iterate by default), scalar struct, and `@.` - #12 by mbauman](https://discourse.julialang.org/t/recent-broadcast-changes-iterate-by-default-scalar-struct-and/11178/12)

---

<div class="post-metadata">

### Author: ![Gnimuc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gnimuc/32/2194_2.png) [@Gnimuc](https://discourse.julialang.org/u/Gnimuc)
#### Post date: [February 7, 2019, 6:20am UTC](https://discourse.julialang.org/t/equivalent-of-ref-in-a-ref/20478/3 "2019-02-07T06:20:31Z")

</div>

~~I’m wondering what’s the purpose of using `Ref(a)` here.~~  
oh, never mind. found the reason in the above link.
