vl4dimir / ObjectiveMixin

Ruby-like mixin functionality for Objective-C programs.
BSD 2-Clause "Simplified" License
217 stars 17 forks source link

[feature request] Sane mixing of conflicting mixins #10

Open skull-squadron opened 11 years ago

skull-squadron commented 11 years ago

Given something like:

 @interface X : NSObject <FooMixin, BarMixin>

Both FooMixin and BarMixin define method 'hello'.

TLDR: a way to call all mixed hello's, in mixin order, returning the result of the last.

Could well be wrong, but assume the default behavior of mixing:

The behavior needed is a way to annotate in X that hello should perform all mixed hello's.

This would be useful for DRY, especially for patterns that set defaults in protocol methods.

Imagine being able to implicitly modify viewDidLoad sanely from clean concerns. Now we're talking cleaner, modular code.

Itheme commented 11 years ago

And what about selector return values?

vl4dimir commented 11 years ago

Hm, a very interesting feature request. But indeed, what about return values? Would it be good enough if this extension would only support selectors which return void?