# How to broadcast over only certain function arguments?

**URL:** <https://discourse.julialang.org/t/how-to-broadcast-over-only-certain-function-arguments/19274>\
**Category:** General Usage\
**Tags:** question, broadcast\
**Created:** [January 4, 2019, 4:09pm UTC](https://discourse.julialang.org/t/how-to-broadcast-over-only-certain-function-arguments/19274 "2019-01-04T16:09:58Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![ffevotte](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ffevotte/32/6587_2.png) [@ffevotte](https://discourse.julialang.org/u/ffevotte)\
**Post date:** [January 4, 2019, 4:39pm UTC](https://discourse.julialang.org/t/how-to-broadcast-over-only-certain-function-arguments/19274/3 "2019-01-04T16:39:10Z")

</div>

Also see this (ongoing) discussion:

> [@recent broadcast changes (iterate by default), scalar struct, and \`@.\`](https://discourse.julialang.org/t/recent-broadcast-changes-iterate-by-default-scalar-struct-and/11178):
>
> The current broadcasting behavior is non-intuitive when used with @. Julia Version 0.7.0-DEV.5222, Commit 7144b6b816 (2018-05-25 20:23 UTC) This is a minimal example, stripped down from a real use case. struct Material a::Float64 end chi(m::Material, energy) = m.a / energy m1 = Material(1.0) energy = 1.5:0.5:2.5 chi1 = @. chi(m1, energy) ┌ Warning: broadcast will default to iterating over its arguments in the future. Wrap arguments of │ type `x::Material` with `Ref(x)` to ensure they b…

---

_[View the full topic](https://discourse.julialang.org/t/how-to-broadcast-over-only-certain-function-arguments/19274)._
