On Feb 4, 2016, at 4:56 PM, Charles Jenkins wrote:
Supposedly in a protocol, “Self” is the class implementing the
protocol. So it seems to me that extension methods should be able to
have a return type of Self so they can return self, and thus have
the extension method behave the same as
I’m trying to learn how to use protocols and extensions to factor out redundant
function bodies.
Supposedly in a protocol, “Self” is the class implementing the protocol. So it
seems to me that extension methods should be able to have a return type of Self
so they can return self, and thus have
FYI, the swift-users list is a great place to ask questions about the Swift
language (that don’t involve platform APIs.) Lots of expert users there,
including Chris Lattner and other members of Apple’s Swift team.
https://lists.swift.org/mailman/listinfo/swift-users
On Feb 4, 2016, at 05:03 , Charles Jenkins wrote:
>
> am I tilting at a windmill?
The problem is that the protocol in unspecific as to what kind of types it can
be applied to, and your intentions don’t work if the type is a struct**. In
fact, you only apply it to classes