On 2011-06-02 09:58:06 -0400, bearophile <[email protected]> said:
Michel Fortin:
That said, if Walter doesn't like it I could change it to a more
"standard" pragma syntax:
pragma(objc_selector, "insertIdemWithObjectValue:atIndex:")
void insertItem(ObjcObject object, NSInteger value);
It's more verbose and less readable, but it'd work too.
Another possible syntax, using ddoc:
/// This is a selector for...
void insertItem(ObjcObject object, NSInteger value); ///
insertItemWithObjectValue:atIndex:
Actually, that's not a very good idea because the selector is not
documentation. The compiler cannot ignore it.
With the Objective-C runtime, each function has a selector matching its
actual Objective-C method name. The selector is what the compiler uses
to call the function dynamically. The method name shouldn't be stripped
like it was a comment or some documentation because that'll change and
likely break the program.
--
Michel Fortin
[email protected]
http://michelf.com/