export Base.@kwdef
The Base.@kwdef is such a useful feature. I cannot think of any reason why it should not be exported. Is there any concern doing that?
Come to think of it, another option is to support that syntax directly in the language without using any macro. Maybe that could be a 2.0 target?
I agree. This would be a nice feature for 1.6, since that will be the new Long-Term Support version.
I had really always hoped that we'd get a better solution instead of baking @kwdef in as official 😞. At the very least it could have a better name.
like supporting the syntax that @kwdef provides in structs? I guess all @kwdef about is having such a syntax? and it seems well adopted by the community already.
any updates on this?
@logankilpatrick I think you tagged the wrong person.
I would also love to see this as a stable feature
It's been almost a few years since this issue was opened. Any chance this could still happen? :)
From triage: yes we might as well export this. It's unfortunately too expensive to generate keyword constructors for every struct, and I don't see that changing without major changes to the language. We can however support default values for trailing fields in normal struct definitions, just like optional positional arguments. I suspect waiting for that feature (and wondering whether it is actually worthwhile) was part of what held up @kwdef.