# Function arguments variable

**URL:** https://discourse.julialang.org/t/function-arguments-variable/76208
**Category:** General Usage
**Tags:** functions
**Created:** [February 11, 2022, 5:20am UTC](https://discourse.julialang.org/t/function-arguments-variable/76208 "2022-02-11T05:20:34Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Lincoln\_Hannah](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lincoln_hannah/32/19198_2.png) [@Lincoln\_Hannah](https://discourse.julialang.org/u/Lincoln_Hannah)
#### Post date: [February 11, 2022, 5:20am UTC](https://discourse.julialang.org/t/function-arguments-variable/76208/1 "2022-02-11T05:20:35Z")

</div>

Is there a variable within a function that will return all function arguments as a named tuple (or something similar). Would be useful when calling a second function, that uses a similar set of arguments.

```julia
f2(; a,b,c ) = a+b+c

function f1(; a, b)
    c=a+b
    f2(; c, AllArgs... )
begin

```

---

<div class="post-metadata">

### Author: ![amrods](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/amrods/32/2543_2.png) [@amrods](https://discourse.julialang.org/u/amrods)
#### Post date: [February 11, 2022, 11:25am UTC](https://discourse.julialang.org/t/function-arguments-variable/76208/2 "2022-02-11T11:25:06Z")

</div>

You can use slurping (documented [here](https://docs.julialang.org/en/v1/manual/faq/#The-two-uses-of-the-...-operator:-slurping-and-splatting)):

```julia
function f(; vars...)
    println(vars)
end

```

yielding

```julia
julia> f(; a=1, b=2)
Base.Pairs(:a => 1, :b => 2)

```

EDIT: for example:

```julia
f2(; a, b, c) = a + b + c

function f0(; vars...)
    c = vars[:a] + vars[:b]
    f2(; vars..., c=c)
end

```
