# Is there some syntax for passing a generator to a function taking variadic args? e

**URL:** <https://discourse.julialang.org/t/is-there-some-syntax-for-passing-a-generator-to-a-function-taking-variadic-args-e/55743>\
**Category:** General Usage\
**Created:** [February 21, 2021, 9:53pm UTC](https://discourse.julialang.org/t/is-there-some-syntax-for-passing-a-generator-to-a-function-taking-variadic-args-e/55743 "2021-02-21T21:53:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![BridgeBot](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bridgebot/32/21491_2.png) [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Post date:** [February 21, 2021, 9:53pm UTC](https://discourse.julialang.org/t/is-there-some-syntax-for-passing-a-generator-to-a-function-taking-variadic-args-e/55743/1 "2021-02-21T21:53:58Z")

</div>

Is there some syntax for passing a generator to a function taking variadic args? e.g.

```julia
hcat([i, i, i] for i in 1:10)

```

I know I can splat an array, but the intermediate array seems unnecessary

```julia
hcat([[i, i, i[for i in 1:10]...)

```

Thanks!

Note that the original poster on Slack cannot see your response here on Discourse. Consider _transcribing the appropriate answer back to Slack_, or pinging the poster here on Discourse so they can _follow this thread_.  
[(Original message :slack:)](https://julialang.slack.com/archives/C6A044SQH/p1613944410091400?thread_ts=1613944410.091400&cid=C6A044SQH) [(More Info)](https://github.com/JuliaCommunity/SlackBridge)

---

<div class="post-metadata">

**Author:** ![Henrique\_Becker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrique_becker/32/15443_2.png) [@Henrique\_Becker](https://discourse.julialang.org/u/Henrique_Becker)\
**Post date:** [February 21, 2021, 10:49pm UTC](https://discourse.julialang.org/t/is-there-some-syntax-for-passing-a-generator-to-a-function-taking-variadic-args-e/55743/2 "2021-02-21T22:49:23Z")

</div>

You do not need an intermediary array, you can have an intermediary iterator:

```julia
hcat(([i, i, i] for i in 1:10)...)

```

Note the parentheses in place of the brackets.
