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

Dmitri Gribenko gribozavr at gmail.com
Wed May 25 12:28:42 CDT 2016


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.

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>*/


More information about the swift-evolution mailing list