[swift-evolution] [Draft] Mixins

Антон Жилин antonyzhilin at gmail.com
Sat Feb 27 07:10:12 CST 2016


I agree that adding those features to protocols is simpler. I switched the
main suggestion and the alternative.

2016-02-27 15:03 GMT+03:00 Haravikk <swift-evolution at haravikk.me>:

> Very interesting alternative!
>
> I think my preferred implementation is to just add these capabilities to
> protocols directly, as I guess I just don’t see why we need to introduce a
> separate mixin type. Providing implementation directly within a protocol is
> definitely something I’d like in general; while extensions can be a nice
> way to structure complex protocols and types, sometimes simple cases just
> don’t really need them IMO, so that’d be nice as a general capability, not
> just for mixins.
>
> On 27 Feb 2016, at 09:59, Антон Жилин via swift-evolution <
> swift-evolution at swift.org> wrote:
>
> Some people opposed to Abstract Classes proposal (including myself) have
> said that mixins could solve the problem better.
> So I prepaired a proposal draft to add stored properties to protocols.
> Here it is:
> https://gist.github.com/Anton3/f0550922c1be0fc5447c
>
> P.S. I added a `mixin` keyword in the beginning, but we can opt to just
> extend protocols, which I mention in "alternatives".
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160227/cad0802e/attachment.html>


More information about the swift-evolution mailing list