# Ellipsis (splatting) with named arguments

**URL:** <https://discourse.julialang.org/t/ellipsis-splatting-with-named-arguments/91170>\
**Category:** New to Julia\
**Tags:** function\
**Created:** [December 3, 2022, 9:54am UTC](https://discourse.julialang.org/t/ellipsis-splatting-with-named-arguments/91170 "2022-12-03T09:54:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![\_stla](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/_stla/32/35613_2.png) [@\_stla](https://discourse.julialang.org/u/_stla)\
**Post date:** [December 3, 2022, 9:54am UTC](https://discourse.julialang.org/t/ellipsis-splatting-with-named-arguments/91170/1 "2022-12-03T09:54:34Z")

</div>

Hello,

Let these two functions:

```julia
function f(x, a, b)
  return b*(x+a)
end

function g(args....)
  return f(1, args...)
end

```

If we run `g(2,3)`, we get `f(1, 2, 3)`.

Is there a way to do `g(b=3, a=2)` and get the same result? Not sure I’m clear…

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [December 3, 2022, 9:57am UTC](https://discourse.julialang.org/t/ellipsis-splatting-with-named-arguments/91170/2 "2022-12-03T09:57:51Z")

</div>

> [@\_stla](#):
>
> `f(1, args...)`

`f(1; args...)` put a semi-colon so they go to the keyword arguments.

---

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [December 3, 2022, 10:00am UTC](https://discourse.julialang.org/t/ellipsis-splatting-with-named-arguments/91170/3 "2022-12-03T10:00:27Z")

</div>

But first you must redefine `f` to take keyword arguments.

---

<div class="post-metadata">

**Author:** ![\_stla](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/_stla/32/35613_2.png) [@\_stla](https://discourse.julialang.org/u/_stla)\
**Post date:** [December 3, 2022, 10:00am UTC](https://discourse.julialang.org/t/ellipsis-splatting-with-named-arguments/91170/4 "2022-12-03T10:00:50Z")

</div>

Ok, I found. This is not enough. I have to define `f(x; a, b)` and `g(; args...)`. Right?

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [December 3, 2022, 10:06am UTC](https://discourse.julialang.org/t/ellipsis-splatting-with-named-arguments/91170/5 "2022-12-03T10:06:55Z")

</div>

Yes
