# How to reference a function's arguments inside the function as a list

**URL:** https://discourse.julialang.org/t/how-to-reference-a-functions-arguments-inside-the-function-as-a-list/135084
**Category:** New to Julia
**Tags:** question
**Created:** [January 15, 2026, 7:02pm UTC](https://discourse.julialang.org/t/how-to-reference-a-functions-arguments-inside-the-function-as-a-list/135084 "2026-01-15T19:02:32Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![teacup775](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/teacup775/32/219999_2.png) [@teacup775](https://discourse.julialang.org/u/teacup775)
#### Post date: [January 15, 2026, 7:02pm UTC](https://discourse.julialang.org/t/how-to-reference-a-functions-arguments-inside-the-function-as-a-list/135084/1 "2026-01-15T19:02:32Z")

</div>

I have a general boilerplate coding workflow..

function dosomething(df, a, b, c, d .. n)  
push!(df, [_all those arguments_])  
end

In other words, I would like to find a way where I don’t have to hand transcribe the input values for push into an array. There has to be some way to reference the parameter list given in the function, definition and simply push the declared argument list into an array, so I don’t have to manually type this out all the time when I’m writing a function.

Is there a clean way to do this?

---

<div class="post-metadata">

### Author: ![Benny](https://avatars.discourse-cdn.com/v4/letter/b/49beb7/32.png) [@Benny](https://discourse.julialang.org/u/Benny)
#### Post date: [January 15, 2026, 7:20pm UTC](https://discourse.julialang.org/t/how-to-reference-a-functions-arguments-inside-the-function-as-a-list/135084/2 "2026-01-15T19:20:01Z")

</div>

If you specify that many arguments by name, those are the names you have to work with in the method body. There’s no automatic hidden argument name for a collection of a trailing subset of those arguments, and you didn’t specify that subset anyway.

What does work for a trailing subset of arguments are [Varargs methods](https://docs.julialang.org/en/v1/manual/functions/#Varargs-Functions). If you don’t need those individual argument names, you can just make a name for the collection (a tuple):

```julia-auto
function dosomething(df, args...) # method assigns tuple containing trailing inputs to args
    push!(df, args...) # call separates args... into separate inputs
end

dosomething([], a, b, c, d) # [a, b, c, d]

```

`n` input values is a lot, which makes me suspect those input values were in a collection to begin with. If so, there’s no need to index every element before insertion to another collection, just use `append!`.
