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

default value for type #159

Open
rveltz opened this issue Aug 30, 2024 · 1 comment
Open

default value for type #159

rveltz opened this issue Aug 30, 2024 · 1 comment

Comments

@rveltz
Copy link

rveltz commented Aug 30, 2024

Hi,

Is it possible to do something like

@with_kw struct A{T,S}
     a::T = 1
     S = String
end

or something like

@with_kw struct A{T,S}
     a::T = 1
     S = a==1
end
@mauro3
Copy link
Owner

mauro3 commented Sep 2, 2024

No (at least if I understand your request correctly). Something like

@with_kw struct A{T,S = 6}
     a::T = 1
end

would probably be a good syntax.

Anyway, I don't plan to add that feature. And I would probably be a bit hesitant to look into a PR, but could be convinced.

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