# Define f with keyword arguments: function f does not accept keyword arguments

**URL:** <https://discourse.julialang.org/t/define-f-with-keyword-arguments-function-f-does-not-accept-keyword-arguments/24186>\
**Category:** New to Julia\
**Created:** [May 13, 2019, 7:45pm UTC](https://discourse.julialang.org/t/define-f-with-keyword-arguments-function-f-does-not-accept-keyword-arguments/24186 "2019-05-13T19:45:41Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![taqtiqa-mark](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/taqtiqa-mark/32/4383_2.png) [@taqtiqa-mark](https://discourse.julialang.org/u/taqtiqa-mark)\
**Post date:** [May 13, 2019, 11:03pm UTC](https://discourse.julialang.org/t/define-f-with-keyword-arguments-function-f-does-not-accept-keyword-arguments/24186/13 "2019-05-13T23:03:17Z")

</div>

**Update:**  
The following was an artifact of using the same REPL session used to define `f(a=1,b=2)`:

> [@taqtiqa-mark](#):
>
> After some digging I realized I had thought I was looking at something like this definition:
> 
> ```julia
> julia> f(; a=1,b=2)=2a+4b
> f (generic function with 3 methods)
> julia> f(b=1,a=2)
> 8
> 
> ```

In fact in `v1.0.2` using a clean REPL:

```julia
julia> f(;a=1,b=2)=2a+4b
f (generic function with 1 method)

julia> f(b=1,a=2)
8

julia> f()
10

```

For those following along at home…

@klaff and I [were](https://discourse.julialang.org/t/fun-with-kwargs-methods/15711) not [alone…](https://github.com/JuliaLang/julia/issues/9498).  
Some attempt at [documenting what the current behavior is…](https://github.com/JuliaLang/julia/pull/32020)

---

_[View the full topic](https://discourse.julialang.org/t/define-f-with-keyword-arguments-function-f-does-not-accept-keyword-arguments/24186)._
