From: Jim Freeze Date: 2005-10-06T05:17:14+09:00 Subject: Re: RybyCocoa (was The definitive GUI for Ruby) On 10/5/05, Rich Morin wrote: > You may be interested to know about > > RubyCocoa - A Ruby/Objective-C Bridge for Mac OS X with Cocoa > http://rubycocoa.sourceforge.net/doc > > * Objective-C has its own naming conventions and method invocation > syntax, which are quite different from those used by Ruby, Python, > etc. In CamelBones, this means that the programmer has to look up > methods by "translated" names, etc. From my limited experience, there is a straightforward pattern to follow to convert from OC to Ruby. For example, from the tutorial: [oPanel runModalForDirectory:self file:nil types nil] becomes oPanel.runModalForDirectory_file_types(self, nil, nil) "The other technique can be used to make a little more sense of method names that are extremely long. Using this technique, the method name consists of everything in the Objective-C method's name up to the first detached parameter name. The rest of the parameter names are moved into the argument list. Thus, every argument after the first is prefaced with another argument that is a Ruby symbol with the same name as the parameter it represents. It sounds confusing, I know, but the example below shows you how easy it is once you get used to the syntax." And, when standard calls return an NSArray or NSString, just use #to_a and #to_s to convert them to ruby. -- Jim Freeze