[swift-evolution] Proposal - Allow properties in Extensions

Brent Royal-Gordon brent at architechies.com
Fri Dec 18 14:49:31 CST 2015


> I only see the benefits on this.
> 	• We don't have to store all states in one file. States can be stored separately. So, we can write code in more composition style.
> 	• We can add new states to the existing type. Not just NSObject subclass with associated object.

I think people generally want this; the question is how to implement it, and especially how to implement it *without* either limiting it to types in the same module, or dangling what amounts to a dictionary off every single object and struct. (Structs are more difficult than objects, because they don’t have stable identities.) Any ideas?

-- 
Brent Royal-Gordon
Architechies



More information about the swift-evolution mailing list