Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for kwdef constructors #62

Open
Tortar opened this issue Jan 20, 2024 · 1 comment
Open

Support for kwdef constructors #62

Tortar opened this issue Jan 20, 2024 · 1 comment

Comments

@Tortar
Copy link
Contributor

Tortar commented Jan 20, 2024

e.g. I imagine a syntax like

@sum_type @kwdef AT begin
    A(common_field::Int = 3, a::Bool = true, b::Int)
    B(common_field::Int = 1, a::Int, b::Float64 = 4.0, d::Complex)
end

and so it will work creating new all keywords constructors for each variant just like the kwdef macro works

julia> A(; b = 4)
A(3, true, 4)::AT

I will try to work out the details if this feature is welcomed

@MasonProtter
Copy link
Owner

yeah that'd be nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants