# Call function without Keywordarguments with an empty NamedTuple

**URL:** https://discourse.julialang.org/t/call-function-without-keywordarguments-with-an-empty-namedtuple/49653
**Category:** General Usage
**Tags:** question, function, namedtuple
**Created:** [November 6, 2020, 12:17am UTC](https://discourse.julialang.org/t/call-function-without-keywordarguments-with-an-empty-namedtuple/49653 "2020-11-06T00:17:43Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![oskar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oskar/32/12494_2.png) [@oskar](https://discourse.julialang.org/u/oskar)
#### Post date: [November 6, 2020, 12:17am UTC](https://discourse.julialang.org/t/call-function-without-keywordarguments-with-an-empty-namedtuple/49653/1 "2020-11-06T00:17:43Z")

</div>

Since it is possible to call functions with NamedTuples, I was wondering if there is a way to call a function that has no keywordarguments with an empty NamedTuple, and if not, why is it not desirable?

I.e.

```julia
function f()
    [...]
end
f(NamedTuple())

```

---

<div class="post-metadata">

### Author: ![josePereiro](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/josepereiro/32/17322_2.png) [@josePereiro](https://discourse.julialang.org/u/josePereiro)
#### Post date: [November 8, 2020, 11:20pm UTC](https://discourse.julialang.org/t/call-function-without-keywordarguments-with-an-empty-namedtuple/49653/2 "2020-11-08T23:20:03Z")

</div>

Yes, you can!

```julia
test() = println("Hi") # no args no kwargs
kwargs = NamedTuple()
args = tuple()
test(args...;kwargs...)
# Hi

```

The difference with your code example is that I used `...` which unpack the arguments. `f(NamedTuple())` is reserved to mean a function with one argument that is a empty NamedTuple.

---

<div class="post-metadata">

### Author: ![oskar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oskar/32/12494_2.png) [@oskar](https://discourse.julialang.org/u/oskar)
#### Post date: [November 9, 2020, 8:56pm UTC](https://discourse.julialang.org/t/call-function-without-keywordarguments-with-an-empty-namedtuple/49653/3 "2020-11-09T20:56:05Z")

</div>

Oh, I totally forgot that! I was usually using the `...` in the function itself but did forget that they could be used also in the function call!  
Thank you!
