On 2009-09-06 08:32:43 -0400, Christopher Wright <[email protected]> said:

Off topic, but this would be a good place for user-defined attributes. Then you could write something like:

@IBAction void openWindow(Object sender) {}

Indeed... although IBAction isn't so bad as a mixin, it gets much worse with ObjcMethod where it is necessary to list all the argument types to allow resolving overloaded functions:

        void doOneAndTwo(int i, int j) {}

        mixin ObjcMethod(void, doOneAndTwo, "doOne:andTwo:", int, int);

Compare to what could be done with a parametrized attribute:

        @ObjcMethod("doOne:andTwo:") void doOneAndTwo(int i, int j);

That'd would be a lot more convenient, especially with interfaces for which none of the mixin above can work (they insert some static struct member to store the "attributes").


--
Michel Fortin
[email protected]
http://michelf.com/

Reply via email to