# How do I define a function whose argument is iterable?

**URL:** https://discourse.julialang.org/t/how-do-i-define-a-function-whose-argument-is-iterable/42484
**Category:** New to Julia
**Tags:** question
**Created:** [July 3, 2020, 4:33pm UTC](https://discourse.julialang.org/t/how-do-i-define-a-function-whose-argument-is-iterable/42484 "2020-07-03T16:33:05Z")
**Posts on this page:** 1
**Showing post:** 6

<div class="post-metadata">

### Author: ![Mason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mason/32/2423_2.png) [@Mason](https://discourse.julialang.org/u/Mason)
#### Post date: [July 3, 2020, 6:19pm UTC](https://discourse.julialang.org/t/how-do-i-define-a-function-whose-argument-is-iterable/42484/6 "2020-07-03T18:19:33Z")

</div>

There was some discussion of this recently here: [What's the best way to dispatch on an \_iterable\_ trait?](https://discourse.julialang.org/t/whats-the-best-way-to-dispatch-on-an-iterable-trait/42084).

The TLDR is: yes, you can do this (and you can do it efficiently), but there’s probably a better way to get what you want.

---

_[View the full topic](https://discourse.julialang.org/t/how-do-i-define-a-function-whose-argument-is-iterable/42484)._
