# Anyone know how to do broadcasting on a function with a non-iterable argument? i.e

**URL:** <https://discourse.julialang.org/t/anyone-know-how-to-do-broadcasting-on-a-function-with-a-non-iterable-argument-i-e/55051>\
**Category:** General Usage\
**Created:** [February 11, 2021, 9:47am UTC](https://discourse.julialang.org/t/anyone-know-how-to-do-broadcasting-on-a-function-with-a-non-iterable-argument-i-e/55051 "2021-02-11T09:47:00Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![bgroenks](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bgroenks/32/21784_2.png) [@bgroenks](https://discourse.julialang.org/u/bgroenks)\
**Post date:** [February 11, 2021, 9:49am UTC](https://discourse.julialang.org/t/anyone-know-how-to-do-broadcasting-on-a-function-with-a-non-iterable-argument-i-e/55051/2 "2021-02-11T09:49:19Z")

</div>

Whoops totally missed this post…

> [@Broadcasting structs as scalars](https://discourse.julialang.org/t/broadcasting-structs-as-scalars/14310):
>
> The following code used to work in Julia v0.6.4, but it is not working in Julia v1.0. struct Q x::Int end f(q::Q, x::Int) = q.x + x f.(Q(2), [1,2,3]) # ERROR: MethodError: no method matching length(::Q) What should I do to broadcast on Q as a scalar?

That’s the solution!

---

_[View the full topic](https://discourse.julialang.org/t/anyone-know-how-to-do-broadcasting-on-a-function-with-a-non-iterable-argument-i-e/55051)._
