-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Add macro to simplify libgit2 type constructor definitions #19473
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
Conversation
|
I also changed a couple of fields from |
base/libgit2/types.jl
Outdated
| """ | ||
| @kwdef typedef | ||
| This is a helper macro that automatically defines a keyword-based constructor for the type declared in the expression `typedef`, which must be a `type` or `immutable` expression. The default argument is supplied by declaring fields of the form `field::Type = default`. If no default is provided then the default is: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps this should be broken onto multiple lines?
f4be7d8 to
284e9f7
Compare
|
This should probably be in util.jl or something since it's not really libgit2 specific. |
284e9f7 to
a191ec3
Compare
|
I like this idea. We should probably have language features for this kind of thing eventually. |
|
If we're going to have it be more general and user-facing, we might want to make the name a little more specific. I don't have a better suggestion though... |
|
I've moved it, open to better suggestions on names. |
This adds a macro that automatically defines a keyword argument only constructor for a type declaration.
up a few pointer conversions.
079724c to
fb16580
Compare
| immutable RebaseOptions | ||
| version::Cuint | ||
| quiet::Cint | ||
| Matches the `git_rebase_options` struct. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no link for this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, their HTML docs are a bit incomplete.
|
Any more thoughts on this? |
This adds a macro that automatically defines a keyword argument only constructor for a type declaration.