Future MacRuby support for "name-mangling" ?
Hello, Both JRuby and IronRuby support translation from 'native' CamelCase method names to the lowercase_with_underscores naming convention in idiomatic Ruby. They IronRuby guys call this "name-mangling": http://ironruby.net/Documentation/.NET/Names I had an expectation that this would be the case with MacRuby, but I now know that this is not true. Are there any plans to implement this feature in the future? You can probably guess that I like this feature an awful lot. Regards, Scott
Hi Scott, MacRuby's spiritual predecessor RubyCocoa did this sort of substitution of camelCase for under_case. However, I don't foresee this name-mangling being a part of MacRuby's near future for one very important reason: MacRuby methods *are* Objective-C methods. I'm not aware of the particulars of the IronRuby or JRuby bridges, but in the case of RubyCocoa, there is a translation step to get from a Ruby method name to an Objective-C selector. In MacRuby, there is no transation step. MacRuby method names are Objective-C selectors and vice versa. So, we'd have to *add* a step in the method dispatch to do translation (since there isn't already one). It's not impossible, but I would guess it's pretty low on the priority list at the moment. Cheers, Josh On Nov 14, 2010, at 11:51 AM, Scott Lowe wrote:
Hello,
Both JRuby and IronRuby support translation from 'native' CamelCase method names to the lowercase_with_underscores naming convention in idiomatic Ruby.
They IronRuby guys call this "name-mangling": http://ironruby.net/Documentation/.NET/Names
I had an expectation that this would be the case with MacRuby, but I now know that this is not true. Are there any plans to implement this feature in the future? You can probably guess that I like this feature an awful lot.
Regards,
Scott _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
It actually is also helpful to quickly see the difference between Obj-c/C methods/functions & Ruby methods. It also helps with documentation. I agree with Joshua, I don't see that change happening anytime soon either. - Matt Sent from my iPhone On Nov 14, 2010, at 12:49, Joshua Ballanco <jballanc@gmail.com> wrote:
Hi Scott,
MacRuby's spiritual predecessor RubyCocoa did this sort of substitution of camelCase for under_case. However, I don't foresee this name-mangling being a part of MacRuby's near future for one very important reason: MacRuby methods *are* Objective-C methods.
I'm not aware of the particulars of the IronRuby or JRuby bridges, but in the case of RubyCocoa, there is a translation step to get from a Ruby method name to an Objective-C selector. In MacRuby, there is no transation step. MacRuby method names are Objective-C selectors and vice versa. So, we'd have to *add* a step in the method dispatch to do translation (since there isn't already one). It's not impossible, but I would guess it's pretty low on the priority list at the moment.
Cheers,
Josh
On Nov 14, 2010, at 11:51 AM, Scott Lowe wrote:
Hello,
Both JRuby and IronRuby support translation from 'native' CamelCase method names to the lowercase_with_underscores naming convention in idiomatic Ruby.
They IronRuby guys call this "name-mangling": http://ironruby.net/Documentation/.NET/Names
I had an expectation that this would be the case with MacRuby, but I now know that this is not true. Are there any plans to implement this feature in the future? You can probably guess that I like this feature an awful lot.
Regards,
Scott _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Hi Scott, Supporting this has been in discussion for a while, however I'm against it for consistency sake. If we allow methods to be defined or messaged using different styles, it can create confusion and ambiguity in some cases (especially if you start overloading methods). If you have a good feature proposal in mind, feel free to describe it, maybe this could be implemented in a way confusion and ambiguity will be avoided. Laurent On Nov 14, 2010, at 8:51 AM, Scott Lowe wrote:
Hello,
Both JRuby and IronRuby support translation from 'native' CamelCase method names to the lowercase_with_underscores naming convention in idiomatic Ruby.
They IronRuby guys call this "name-mangling": http://ironruby.net/Documentation/.NET/Names
I had an expectation that this would be the case with MacRuby, but I now know that this is not true. Are there any plans to implement this feature in the future? You can probably guess that I like this feature an awful lot.
Regards,
Scott _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
participants (4)
-
Joshua Ballanco
-
Laurent Sansonetti
-
Matt Aimonetti
-
Scott Lowe