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 optional fields? #40

Open
ExpandingMan opened this issue Mar 17, 2019 · 3 comments
Open

support for optional fields? #40

ExpandingMan opened this issue Mar 17, 2019 · 3 comments

Comments

@ExpandingMan
Copy link

I'm not sure I really understand what's going on here yet, so forgive me if this is a stupid question, but it seems to me that FlatBuffer fields are always optional, however this package does not seem to support that as the constructors it defines to not seem to allow undefined fields.

Is this a missing feature, or am I just missing something here?

@ExpandingMan
Copy link
Author

Sorry, I now know somewhat better what I'm talking about and I now know what my issues were.

So yes, it appears flatbuffers wants you to allow for the possibility of all fields being optional. What "optional" means in the corresponding Julia struct depends somewhat on what the field is.

Anyway, this brings me to a bigger question. Right now the Julia convenience macros are missing a few features such as setting some reasonable default field values and two of the default constructors. I would say that, at the very least, if we do not anticipate the flatc PR getting merged any time soon, it would be really nice if we could have better helper macros in this package. Such macros would potentially be quite useful even with flatc, as it could potentially generate simpler looking code, though in that case we'd be sacrificing some explicitness.

What are everyone's thoughts on having a few additional macros which generate the above? I'm currently working on overhauling Arrow, so I might make sense for me to make a PR for this so that I could use it there.

@rjkat
Copy link
Contributor

rjkat commented Mar 17, 2019

Glad to hear any suggestions and happy to review PRs. I also left a comment in the flatc pull request about what's left to be done there.

@ExpandingMan
Copy link
Author

Cool thanks.

If I have a specific plan I'll post it here. Whether I take this on will depend on how much I feel I need it for Arrow.jl.

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