# Why Base.@kwdef is not exported?

**URL:** https://discourse.julialang.org/t/why-base-kwdef-is-not-exported/46328
**Category:** New to Julia
**Tags:** base
**Created:** [September 9, 2020, 1:31pm UTC](https://discourse.julialang.org/t/why-base-kwdef-is-not-exported/46328 "2020-09-09T13:31:06Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![AtsushiSakai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/atsushisakai/32/6559_2.png) [@AtsushiSakai](https://discourse.julialang.org/u/AtsushiSakai)
#### Post date: [September 9, 2020, 1:31pm UTC](https://discourse.julialang.org/t/why-base-kwdef-is-not-exported/46328/1 "2020-09-09T13:31:06Z")

</div>

Hi. I have a small question about Base.@kwdef.

I think this macro is very useful, already many packages are using Base.@kwdef.  
[https://github.com/search?q="Base.%40kwdef"&type=Code](https://github.com/search?q=%22Base.%40kwdef%22&type=Code)

I don’t know why @kwdef is not exported here?  
[https://github.com/JuliaLang/julia/blob/01b29ec71a8491d3e2f423546639d023765c556a/base/exports.jl#L940](https://github.com/JuliaLang/julia/blob/01b29ec71a8491d3e2f423546639d023765c556a/base/exports.jl#L940)

Is it not recommended to use this macro?

---

<div class="post-metadata">

### Author: ![Henrique\_Becker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrique_becker/32/15443_2.png) [@Henrique\_Becker](https://discourse.julialang.org/u/Henrique_Becker)
#### Post date: [September 9, 2020, 3:24pm UTC](https://discourse.julialang.org/t/why-base-kwdef-is-not-exported/46328/2 "2020-09-09T15:24:54Z")

</div>

I am not sure about why, however I think it is safe to use it, if you check `?Base.@kwdef` you will see it is well documented, what is often a clear signal it was intended to be used (specially considering the box saying it is available from Julia 1.1 on).

---

<div class="post-metadata">

### Author: ![tk3369](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tk3369/32/2824_2.png) [@tk3369](https://discourse.julialang.org/u/tk3369)
#### Post date: [September 10, 2020, 2:34pm UTC](https://discourse.julialang.org/t/why-base-kwdef-is-not-exported/46328/3 "2020-09-10T14:34:15Z")

</div>

Perhaps +1 this issue? 😉

[https://github.com/JuliaLang/julia/issues/33192](https://github.com/JuliaLang/julia/issues/33192)

---

<div class="post-metadata">

### Author: ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)
#### Post date: [September 10, 2020, 2:34pm UTC](https://discourse.julialang.org/t/why-base-kwdef-is-not-exported/46328/4 "2020-09-10T14:34:59Z")

</div>

> [@Henrique\_Becker](#):
>
> I am not sure about why, however I think it is safe to use it, if you check `?Base.@kwdef` you will see it is well documented, what is often a clear signal it was intended to be used (specially considering the box saying it is available from Julia 1.1 on).

This is not true. If it isn’t exported or in the manual it can dissapear whenever.

---

<div class="post-metadata">

### Author: ![Henrique\_Becker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrique_becker/32/15443_2.png) [@Henrique\_Becker](https://discourse.julialang.org/u/Henrique_Becker)
#### Post date: [September 10, 2020, 2:37pm UTC](https://discourse.julialang.org/t/why-base-kwdef-is-not-exported/46328/5 "2020-09-10T14:37:53Z")

</div>

> [@kristoffer.carlsson](#):
>
> This is not true. If it isn’t exported or in the manual it can dissapear whenever.

Good to know. I checked and did not found it in the last version of the manual, so it is not safe to use.

---

<div class="post-metadata">

### Author: ![lungben](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lungben/32/12314_2.png) [@lungben](https://discourse.julialang.org/u/lungben)
#### Post date: [September 10, 2020, 3:42pm UTC](https://discourse.julialang.org/t/why-base-kwdef-is-not-exported/46328/6 "2020-09-10T15:42:50Z")

</div>

I find `Base.@kwdef` very useful and also think it should be exported.  
Is there any specific reason why it could be removed in the future? Or is it just not documented because no one has done it yet ? 😉
