[swift-evolution] [Proposal] More Powerful Constraints for Associated Types

Douglas Gregor dgregor at apple.com
Mon Apr 25 22:54:52 CDT 2016



Sent from my iPhone

> On Apr 25, 2016, at 8:41 PM, Dmitri Gribenko <gribozavr at gmail.com> wrote:
> 
> On Mon, Apr 25, 2016 at 8:28 PM, Douglas Gregor via swift-evolution
> <swift-evolution at swift.org> wrote:
>> Did you consider an alternate syntax that puts the where clause outside the
>> braces, e.g.,
>> 
>> protocol R : Q where AssocType : P {
>>  // …
>> }
> 
> To me this reads like declaring a conditional conformance.

I'm reading it as "R is-a Q where AssocType is-a P". 
> 
> 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