RubyCocoa parses Cocoa methods that return multiple values through pointer parameters! Check it out:
>> NSWorkspace.sharedWorkspace.getFileSystemInfoForPath_
isRemovable_isWritable_isUnmountable_description_
type_("/Volumes/SparkleCaster/English.lproj")
=> [true, 1, 0, 1, #<NSCFString "hfs">, #<NSCFString "hfs">]
Now we’ve just got to do something about that really ugly method name…









The Conversation {2 comments}
I think there’s always going to be a disconnect between non-Objective-C interfaces to Cocoa for exactly this reason (the message-passing syntax). You can paper over it with dictionary-style name/value mapping, etc., but it’ll never be as good as the original.
That’s why I’m off designing a new dynamic language that exactly matches Objective-C’s syntax & general semantics… ;-)
Ohman, another one? :)
I like Nu in theory, but native arrays and hashes are important to me and, well, I find myself having a lot of trouble keeping a sense of scope in big s-exprs.
But yeah, there will always be some level of disconnect. Unless… maybe Ruby 2.0’s named parameters will help.
Leave a Comment
You can follow any responses to this entry via its RSS comments feed. You can also leave a trackback if the inclination is there.