You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the generator translates the colon in an objective-c method into an underscore. This leads to the undesirable result of methods with names that end with an underscore (e.g. ObjectForKey_() instead of ObjectForKey() ). I suggest that these rules be implemented when generating Go function names:
For class methods we use the format Classname_methodname(). There are times when the method name is shorted, like when the last part of the class name contains the first part the method name (e.g. NSArray_WithObjects() instead of NSArray_arrayWithObjects() ). I do agree with that format but I still think it is a good idea to also include a method that includes the full method name. It is a lot less confusing for new people. Of course the shorted method could lead to confusion as to which objective-c method it wraps, so maybe be should remove all these shorten methods and replace them with more proper names.
Instance methods should use the Go format of using uppercase for the first letter of each word. I don't think we need underscores at all. For example instead of the NSUserDefaults' method SetObject_ForKey() it should be SetObjectForKey(). It looks more Go-like (and pretty 😁).
The text was updated successfully, but these errors were encountered:
I created this patch to translate underscores into nothing. I haven't had the best of luck with Macschema so I need help with testing it out. If anyone could let me know if this patch works, it would be appreciated.
Currently the generator translates the colon in an objective-c method into an underscore. This leads to the undesirable result of methods with names that end with an underscore (e.g. ObjectForKey_() instead of ObjectForKey() ). I suggest that these rules be implemented when generating Go function names:
For class methods we use the format Classname_methodname(). There are times when the method name is shorted, like when the last part of the class name contains the first part the method name (e.g. NSArray_WithObjects() instead of NSArray_arrayWithObjects() ). I do agree with that format but I still think it is a good idea to also include a method that includes the full method name. It is a lot less confusing for new people. Of course the shorted method could lead to confusion as to which objective-c method it wraps, so maybe be should remove all these shorten methods and replace them with more proper names.
Instance methods should use the Go format of using uppercase for the first letter of each word. I don't think we need underscores at all. For example instead of the NSUserDefaults' method SetObject_ForKey() it should be SetObjectForKey(). It looks more Go-like (and pretty 😁).
The text was updated successfully, but these errors were encountered: