Ah; probably no.
Conversation
Even if the protocol describes something that should rightfully have reference semantics? Using a struct for that seems wrong.
1
1
I’m having trouble thinking about this without an example.
1
For example, a protocol that describes a Future. Should implementors be required to be classes?
1
You could write a struct Promise that incorporates a GCD queue or something, but is that even legit?
1
Yes, absolutely. That’s exactly what I was writing about here:
intersections.tumblr.com/post/996340847
3
Agreed with Rob here. If the implementor wants to use a thin struct wrapping a reference, that's on them.
1
2
You want to guarantee that e.g. "then()" results in *exactly* one call to the arg. The rest is impl. detail.
2
2
Replying to
Yeah word. Would be amazing for all kinds of static analysis. e.g. "start a thing; clean up in completion handler…"
Replying to
Okay, I think I’m convinced. I was mostly just playing devil’s advocate. Thanks for the input!
1
1


