[swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>

Thorsten Seitz tseitz42 at icloud.com
Wed May 25 05:29:50 CDT 2016




Am 25. Mai 2016 um 03:07 schrieb Matthew Johnson via swift-evolution <swift-evolution at swift.org>:




On May 24, 2016, at 7:45 PM, Brent Royal-Gordon <brent at architechies.com> wrote:


I believe it was things like "+" and "-" for set union and subtraction, etc.


That, or &, |, and ^, by analogy with bitwise operators. It definitely came up during the SetAlgebra discussions. 


Another thread I guess I didn’t follow closely enough.  I think I agree with avoiding using unconventional operators for operations which already have conventional operators associated with them.  Maybe someday it will be easy enough to type unicode operators that it might be reasonable to think about using them.


Yes, there is precedent in other languages:
Ceylon uses "&" for type intersection (any<>) and "|" for type union (one<>), see http://ceylon-lang.org/documentation/1.2/tour/types/.
TypeScript does the same (see https://www.typescriptlang.org/docs/handbook/advanced-types.html).



-Thorsten
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160525/b9afd9be/attachment.html>


More information about the swift-evolution mailing list