Skip to content

Conversation

@simonbyrne
Copy link
Member

This adds a macro that automatically defines a keyword argument only constructor for a type declaration.

@simonbyrne simonbyrne added the libgit2 The libgit2 library or the LibGit2 stdlib module label Dec 1, 2016
@simonbyrne
Copy link
Member Author

simonbyrne commented Dec 1, 2016

I also changed a couple of fields from Cint to specific Enums.

"""
@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:
Copy link
Member

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?

@tkelman
Copy link
Contributor

tkelman commented Dec 1, 2016

This should probably be in util.jl or something since it's not really libgit2 specific.

@StefanKarpinski
Copy link
Member

I like this idea. We should probably have language features for this kind of thing eventually.

@ararslan
Copy link
Member

ararslan commented Dec 1, 2016

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...

@simonbyrne
Copy link
Member Author

I've moved it, open to better suggestions on names.

immutable RebaseOptions
version::Cuint
quiet::Cint
Matches the `git_rebase_options` struct.
Copy link
Contributor

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?

Copy link
Member Author

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.

@simonbyrne
Copy link
Member Author

Any more thoughts on this?

@tkelman tkelman merged commit 7ba6ad6 into master Dec 30, 2016
@tkelman tkelman deleted the sb/libgit2-kw branch December 30, 2016 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

libgit2 The libgit2 library or the LibGit2 stdlib module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants