Open mcabbott opened 3 days ago
yes, it would be nice to match @kwdef
features but with concrete types and prototypable.
I like more the
@def struct Store
some::Vector
things
end
notation, which can be replaced by @concrete @kwdef struct Store
after prototyping is done.
Maybe out of scope for this package, but this could be the foundation of a pydantic-like package.
This is parallel to https://github.com/FluxML/Fluxperimental.jl/pull/24 in that it adds a "method" to the macro which does this:
That is, it makes a re-definable struct, with just the default constructor. That seems perhaps more broadly what you would want first, outside of Flux.
Whether this is the ideal notation I don't know. It could also be
But that's a much bigger deviation from existing code, and maybe looks more like you have forgotten type parameters.
Needs tests.