[swift-evolution] [Review] SE-0006 Apply API Guidelines to the Standard Library
Dave Abrahams
dabrahams at apple.com
Sat Jan 30 22:32:51 CST 2016
on Fri Jan 29 2016, Brent Royal-Gordon <swift-evolution at swift.org> wrote:
>> Count me among those who liked the ‘Type’ suffix for protocols though.
>
> I wonder if we can't change it to a -`like` suffix. Applying that to 2.1 stdlib gives you:
>
> AnyCollectionlike
> BidirectionalIndexlike
> BitwiseOperationslike
> Booleanlike
> CVarArglike
> Collectionlike
> Errorlike
> FloatingPointlike
> ForwardIndexlike
> Generatorlike
> IntegerArithmeticlike
> Integerlike
> Intervallike
> LazyCollectionlike
> LazySequencelike
> MirrorPathlike
> MutableCollectionlike
> OptionSetlike
> OutputStreamlike
> RandomAccessIndexlike
> RangeReplaceableCollectionlike
> ReverseIndexlike
> Sequencelike
> SetAlgebralike
> SignedIntegerlike
> SignedNumberlike
> UnicodeCodeclike
> UnsignedIntegerlike
>
> Not all of these are perfect, but in some cases that's because they
> should arguably be -able protocols (BitwiseOperationsType ->
> BitwiseOperable).
This is interesting, but the word "like" really weakens the semantic
implications of the protocol, which as I mentioned to Erica is really
important. The Index of my Dictionary isn't just "like" a forward
index, it *is-a* forward index.
--
-Dave
More information about the swift-evolution
mailing list