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

Matthew Johnson matthew at anandabits.com
Wed May 25 12:46:37 CDT 2016



Sent from my iPad

> On May 25, 2016, at 12:28 PM, Dmitri Gribenko via swift-evolution <swift-evolution at swift.org> wrote:
> 
> I like the direction about creating a unified syntax for current
> implementation of existentials and future generalized existentials.  I
> am concerned about the chosen syntax though, I don't think it reads
> right.  I read Any<X, Y> as a union type.
> 
> var x1: Any // OK, 'x1' can have any dynamic type.
> var x2: Any<ErrorProtocol> // OK, 'x2' is any value that conforms to
> ErrorProtocol.
> 
> var x3: Any<Hashable, Comparable> // 'x3' is any of the following
> types.  Either a Hashable, or a Comparable.

Any suggestions? (pun intended) 

> 
> Dmitri
> 
> -- 
> main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
> (j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution



More information about the swift-evolution mailing list