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
x/mobile/bind: lowercase function names for objC #12889
Comments
yes, I am thinking about converting all method names to start with lowercase. Any objection? |
SGTM (Doing it automatically that is. I'd like to minimize the number of options.) |
SGTM, method names must start with lowercase in both languages. |
CL https://golang.org/cl/15780 mentions this issue. |
I have a draft cl l for objective-c (cl/15780). Avoiding name conflicts seems tricky.
Similar exceptions will occur for Java too. |
I think it's worth attempting to do this anyway, because the visible effect on the code is to make it look far more like Obj-C. For conflicts, a carefully placed suffix calculated recursively (_1, _2, etc) can work. Both your points 1 and 3 can be covered by a static list of identifiers, for 2 it is a per-object list of identifiers. |
There was a discussion a year ago about making methods and types lowercase in ObjC (golang/go#12889), which was done (https://go-review.googlesource.com/#/c/15780/), alas the suggested Java lower casing was never addressed. This CL converts all generated Java methods to lower case. Change-Id: Ia2f28519bc59362877881636109ddfc651b24960 Reviewed-on: https://go-review.googlesource.com/28494 Reviewed-by: Elias Naur <elias.naur@gmail.com> Reviewed-by: David Crawshaw <crawshaw@golang.org>
need to update documentation https://godoc.org/golang.org/x/mobile/cmd/gobind It seems that some of name conversions (due to conflicts with reserved keywords) are not intuitive. |
Fixes golang/go#12889. Change-Id: I4b8f5e4b2c4fe53146fc351889664cbeb5a1860b Reviewed-on: https://go-review.googlesource.com/15780 Reviewed-by: David Crawshaw <crawshaw@golang.org>
Fixes golang/go#12889. Change-Id: I4b8f5e4b2c4fe53146fc351889664cbeb5a1860b Reviewed-on: https://go-review.googlesource.com/15780 Reviewed-by: David Crawshaw <crawshaw@golang.org>
This is definitely just a nice-to-have!
In order to comply with style guidelines for objective c and swift, it would be nice if the gomobile bind command had an option to lowercase the first character of exported function names.
The text was updated successfully, but these errors were encountered: