24 May
2008
24 May
'08
9:08 p.m.
On May 24, 2008, at 1:46 PM, Laurent Sansonetti wrote:
Currently this is not possible (same in RubyCocoa), but with the enclosed patch:
I'll try it out.
Any idea regarding a shortcut? (Protocol.protocolWithName is too long). For example we could automatically convert symbols to Protocol objects.
Protocol[:ProtocolName] Protocol.named( 'ProtocolName' ) :ProtocolName.to_protocol 'ProtocolName'.to_protocol With the first one, you could alias :conformsToProtocol to :conformsTo, and have it still read somewhat like the ObjC. obj.conformsTo( Protocol[:ProtocolName] )
Also, calling #inspect on a Protocol object currently crashes (because it's not NSObject-based, where inspect is defined).
Thanks for the tip.