-
Notifications
You must be signed in to change notification settings - Fork 1
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
API Simplification #6
base: main
Are you sure you want to change the base?
Conversation
Sorry, I forgot to emphasize this, but if we set the API first, then we can start writing tests, independently from the implementation. |
This reverts commit ac1513f.
Hey, I've just reverted the last commit. |
I'm not quite sure what to do for enums. But I can make a preliminary remark. The current implementation for What I could propose, if we want to keep the syntax "reader.myenum == :myinstance" would be to wrap myenum into a |
Good stuff, this makes it actually look like Julia. I think the Regarding some of the details:
Let me know how does that sound to you. |
Any plans regarding this pull request? The proposed API seems very nice! |
I don't have any immediate plans with this but I am happy to review PRs if you want to take over this proposal. |
Hey Ondrej,
This is a PR to simplify the API of your package.
I advise to first
read example/addressbook.jl
, to see the potential benefit. We may want to start agreeing on this.Then, we can iterate on the actual implementation.
There are a few things that I'm not sure I like about the proposed API:
Capnp.isenumequal(phone.type, :mobile)
. This is linked to this discussion. I'm not sure yet what the best solution is. We could also dophone.type == :mobile
, but the community seems to not be in favour of that.bob.employment.unemployed
, the secondgetindex
is actually some kind of setter. There is certainly a way to do better.bobPhones = bob.phones(2)
. Let me know if you agree.About the implementation:
typed_pointers.jl
.Also, even if this PR seems to work, there are some mistakes:
Before fixing those mistakes, we may want to test this library. I suggest using this file.