-
Notifications
You must be signed in to change notification settings - Fork 57
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
options for avoiding name collisions #220
Comments
Yeah, the list of reserved names used to be very long, I even considered including all exported names from Base. At some point we trimmed it back, don't really remember why, probably for cosmetic reasons:) So, good you bring this up. As for custom type prefixes, there is AFAIK only one problem -- the My preferred option would be to expand the list of reserved names until we catch all of those that cause trouble (it shouldn't be a breaking change, since we're fixing something in that case). Thoughts? |
Just want to make sure I'm understanding this correctly: the serialization algorithm needs to know the type names (in addition to the field names)? The current behavior of adding I might fool around with this solution later this evening when I go to update the Otherwise, yes of course we should add |
For the proto
Yeah... The nice thing about prefixing with
I mean, if it was completely unconditional (i.e. we'd prefix every definition with statically known prefix), then we could just always strip it before sending the Anyway, I think I'd prefer us expanding the list of reserved keywords... cc: @quinnj |
I think what you just said about why to use No worries, I'll add some keywords later and we'll call it a day. Also once collisions are fixed, there's nothing stopping users from creating their own aliases like I suggested, so I guess there's not really anything that has to be done in the package itself. |
Most name collisions aren't really a problem here thanks to modules, but conflicts with
Base
can still be a problem (for example names likeVector
andArray
).One simple solution to this would be to provide the option to prepend all generated types names with a user-provided prefix. For example with
protojl(files, dir, outdir, type_prefix="Pr")
amessage
calledVector
in Julia code would be calledPrVector
.The text was updated successfully, but these errors were encountered: