making identity a requirement of the protocol is useful, but I’d often prefer that be reified.
Conversation
I don’t actually rely upon it having identity. The whole thing was just: should implementors be forced into a reference type?
1
Ah; probably no.
1
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
Replying to
You want to guarantee that e.g. "then()" results in *exactly* one call to the arg. The rest is impl. detail.
Replying to
Yeah, exactly this. `class` is swatting a mosquito with a sledgehammer.
1
Replying to
2
Yeah word. Would be amazing for all kinds of static analysis. e.g. "start a thing; clean up in completion handler…"
1
1
Show replies


