# Nothing == absence of keyword argument?

**URL:** <https://discourse.julialang.org/t/nothing-absence-of-keyword-argument/108119>\
**Category:** General Usage\
**Tags:** question, keyword-arguments\
**Created:** [December 28, 2023, 7:46am UTC](https://discourse.julialang.org/t/nothing-absence-of-keyword-argument/108119 "2023-12-28T07:46:54Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![heliosdrm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/heliosdrm/32/3851_2.png) [@heliosdrm](https://discourse.julialang.org/u/heliosdrm)\
**Post date:** [December 28, 2023, 8:59am UTC](https://discourse.julialang.org/t/nothing-absence-of-keyword-argument/108119/3 "2023-12-28T08:59:51Z")

</div>

If you know the set of possible keyword argument names accepted by `libraryfunc`, you can filter them out of the keyword arguments passed to `func`:

```julia
function func(; kwargs...)
    ... do something ...
    libraryfunc_kwargs = (`atA`, `atB`, `atC`)
    validkwargs = filter(kwargs) do (key, _)
        key in libraryfunc_kwargs
    end
    libraryfunc(; validkwargs...)
end

```

There you don’t need to know the default values, but still have to define the list of keys accepted by `libraryfunc`, in the variable `libraryfunc_kwargs`. Instead of writing them manually as in the example above, you can [get them with `Base.kwarg_decl`](https://discourse.julialang.org/t/get-the-argument-names-of-an-function/32902/6), although if `libraryfunc` has several methods, you need to choose the one that you mean to call (easier if your function is type-stable).

This would become a bit more complicated if `libraryfunc` accepts variable keyword arguments (`kwargs...`). But in that case, probably you don’t even have to filter the ones passed to `func`.

---

_[View the full topic](https://discourse.julialang.org/t/nothing-absence-of-keyword-argument/108119)._
