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

epb_compatibility overrides module_name_suffix #77

Closed
tsloughter opened this issue Aug 16, 2016 · 5 comments
Closed

epb_compatibility overrides module_name_suffix #77

tsloughter opened this issue Aug 16, 2016 · 5 comments

Comments

@tsloughter
Copy link
Contributor

I use epb_compatibility to tell gpb to generate the encode/1 and decode/2 functions but now it is also forcing the suffix _pb even if i set {module_name_suffix, "'}. I don't think this is proper, is it?

@tsloughter
Copy link
Contributor Author

I'm currently using a work around since I realized that if I simply define {module_name_suffix, ""} before epb_compatibility it will use that value instead of "_pb" :)

@tomas-abrahamsson
Copy link
Owner

(Yes, was going to suggest that workaround as a short-term solution :) )

Hm. I was assuming the Erlang protobuffs always suffixed with _pb, so it'd be a natural thing for an epb_compatibility option to do, maybe even an expected thing of such an option.

Perhaps a sensible way forward would be to add (yet) an option epb_api or epb_functions for the functions, and let the epb_compatibility imply this and the other options outlined in #63. That way, you could specify epb_api (or epb_functions whichever is chosen) instead of epb_compatibility.

You mentioned earlier that you were a mix of erlang_protobuffs and custom code. Is this lacking of _pb suffix part of the custom code? Or am I wrong in my assumption that _pb is always added? (if yes to the latter, then scrap the option idea above)

@tomas-abrahamsson
Copy link
Owner

I've got some code locally in which generation of functions encode/1 and decode/2 is now controlled by an epb_functions instead, which you could use. (And the epb_compatibility option expands to epb_functions plus a few more options)

But I'll wait a bit before pushing that, to hear your story, because I'm still confused about erlang_protobuffs and yet no _pb suffix, because maybe it means some other solution is better.

@tsloughter
Copy link
Contributor Author

Hm, you seem to be right. We weren't actually using epb as a dep but the modules from it for generating the encode/decode functionality and writing it to a file of our own.

So it is only our use case that made this funky :). I'm fine with the workaround hack and we can close this.

@tomas-abrahamsson
Copy link
Owner

Ok. I'll close this, but I'll probably push the epb_functions option in a while anyway, maybe waiting a bit first to see if any more changes pile up. Your workaround will continue to work the same way even with that, I figure.

(I also learned something about option design: if an option is a meta-option that expands to other options, then it should only expand to other options, and not have any extra meaning of its own; such extra meaning should be broken out to separate options instead)

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