<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><br></div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div>More smthg like this:</div><div><br></div><div>protocol PrecedGrpType{}</div><div><p style="margin: 0px; line-height: normal;"><span style="background-color: rgba(255, 255, 255, 0);"><span style="font-variant-ligatures: no-common-ligatures;">enum</span><span style="font-variant-ligatures: no-common-ligatures;"> OperatorAssociativity { </span></span><span style="background-color: rgba(255, 255, 255, 0); font-variant-ligatures: no-common-ligatures;">case</span><span style="background-color: rgba(255, 255, 255, 0); font-variant-ligatures: no-common-ligatures;"> left, right </span><span style="background-color: rgba(255, 255, 255, 0);">}</span></p><p style="margin: 0px; line-height: normal;"><span style="background-color: rgba(255, 255, 255, 0);"><span style="font-variant-ligatures: no-common-ligatures;">enum</span><span style="font-variant-ligatures: no-common-ligatures;"> PrecedenceGroup {</span></span></p><p style="margin: 0px; line-height: normal;"><span style="background-color: rgba(255, 255, 255, 0);"><span style="font-variant-ligatures: no-common-ligatures;"> </span><span style="font-variant-ligatures: no-common-ligatures;">case</span><span style="font-variant-ligatures: no-common-ligatures;">defaultGroup(</span><span style="font-variant-ligatures: no-common-ligatures;">OperatorAssociativity</span><span style="font-variant-ligatures: no-common-ligatures;">)</span></span></p><p style="margin: 0px; line-height: normal;"><span style="background-color: rgba(255, 255, 255, 0);"><span style="font-variant-ligatures: no-common-ligatures;"> </span><span style="font-variant-ligatures: no-common-ligatures;">indirect</span><span style="font-variant-ligatures: no-common-ligatures;"> </span><span style="font-variant-ligatures: no-common-ligatures;">case</span><span style="font-variant-ligatures: no-common-ligatures;">strongerThan(</span><span style="font-variant-ligatures: no-common-ligatures;">OperatorAssociativity</span><span style="font-variant-ligatures: no-common-ligatures;">,</span><span style="font-variant-ligatures: no-common-ligatures;">PrecedenceGroup</span><span style="font-variant-ligatures: no-common-ligatures;">)</span></span></p><p style="margin: 0px; line-height: normal;"><span style="background-color: rgba(255, 255, 255, 0);"><span style="font-variant-ligatures: no-common-ligatures;"> </span><span style="font-variant-ligatures: no-common-ligatures;">indirect</span><span style="font-variant-ligatures: no-common-ligatures;"> </span><span style="font-variant-ligatures: no-common-ligatures;">case</span><span style="font-variant-ligatures: no-common-ligatures;">weakerThan(</span><span style="font-variant-ligatures: no-common-ligatures;">OperatorAssociativity</span><span style="font-variant-ligatures: no-common-ligatures;">,</span><span style="font-variant-ligatures: no-common-ligatures;">PrecedenceGroup</span><span style="font-variant-ligatures: no-common-ligatures;">)</span></span></p><p style="margin: 0px; line-height: normal;"><span style="font-variant-ligatures: no-common-ligatures; background-color: rgba(255, 255, 255, 0);">}</span></p><p style="margin: 0px; line-height: normal; min-height: 13px;"><span style="background-color: rgba(255, 255, 255, 0);"><span style="font-variant-ligatures: no-common-ligatures;"></span><br></span></p><p style="margin: 0px; line-height: normal;"><span style="background-color: rgba(255, 255, 255, 0);"><span style="font-variant-ligatures: no-common-ligatures;">let</span><span style="font-variant-ligatures: no-common-ligatures;"> Additive: </span><span style="font-variant-ligatures: no-common-ligatures;">PrecedenceGroup</span><span style="font-variant-ligatures: no-common-ligatures;"> = .</span><span style="font-variant-ligatures: no-common-ligatures;">defaultGroup</span><span style="font-variant-ligatures: no-common-ligatures;">(.</span><span style="font-variant-ligatures: no-common-ligatures;">left</span><span style="font-variant-ligatures: no-common-ligatures;">)</span></span></p><p style="margin: 0px; line-height: normal;"><span style="background-color: rgba(255, 255, 255, 0);"><span style="font-variant-ligatures: no-common-ligatures;">let</span><span style="font-variant-ligatures: no-common-ligatures;"> Multiplicative: </span><span style="font-variant-ligatures: no-common-ligatures;">PrecedenceGroup</span><span style="font-variant-ligatures: no-common-ligatures;"> = .</span><span style="font-variant-ligatures: no-common-ligatures;">strongerThan</span><span style="font-variant-ligatures: no-common-ligatures;">(.</span><span style="font-variant-ligatures: no-common-ligatures;">left</span><span style="font-variant-ligatures: no-common-ligatures;">, </span><span style="font-variant-ligatures: no-common-ligatures;">Additive</span><span style="font-variant-ligatures: no-common-ligatures;">)</span></span></p><p style="margin: 0px; line-height: normal;"><span style="background-color: rgba(255, 255, 255, 0);"><span style="font-variant-ligatures: no-common-ligatures;">let</span><span style="font-variant-ligatures: no-common-ligatures;"> Exponentiative: </span><span style="font-variant-ligatures: no-common-ligatures;">PrecedenceGroup</span><span style="font-variant-ligatures: no-common-ligatures;"> = .</span><span style="font-variant-ligatures: no-common-ligatures;">strongerThan</span><span style="font-variant-ligatures: no-common-ligatures;">(.</span><span style="font-variant-ligatures: no-common-ligatures;">left</span><span style="font-variant-ligatures: no-common-ligatures;">, </span><span style="font-variant-ligatures: no-common-ligatures;">Multiplicative</span><span style="font-variant-ligatures: no-common-ligatures;">)</span></span></p><div style="font-family: Calibri, sans-serif; font-size: 14px; -webkit-text-size-adjust: auto;"><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);"><br></span></div></div><div>standard Swift, which makes it easier to reflect when the api gets created in 40<br><br><div>Regards<div>LM</div><div>(From mobile)</div></div></div></div><div><br></div><div><br></div><blockquote type="cite"><div><div><div></div></div><div>On Jun 24, 2016, at 2:47 PM, Anton Zhilin via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br><br></div><blockquote type="cite"><div><span>L. Mihalkovic via swift-evolution <swift-evolution@...> writes:</span><br><span></span><br><blockquote type="cite"><blockquote type="cite"><span>Could you please explain what you mean by "meta-circular syntax for </span><br></blockquote></blockquote><span>the </span><br><blockquote type="cite"><blockquote type="cite"><span>precedence group definitions"? An example?</span><br></blockquote></blockquote><blockquote type="cite"><span>=define it using existing swift constructs rather than by extending </span><br></blockquote><span>swift with new kwd looks like grp</span><br><blockquote type="cite"><span>matches a struct. </span><br></blockquote><span></span><br><span>I still don't fully understand without an example :(</span><br><span>If you mean something like this:</span><br><span></span><br><span>protocol PrecedenceGroup_Additive {</span><br><span> associatedtype StrongerThan_Comparative</span><br><span> associatedtype WeakerThan_Multiplicative</span><br><span>}</span><br><span></span><br><span>Then this is just ugly.</span><br><span></span><br><span>_______________________________________________</span><br><span>swift-evolution mailing list</span><br><span><a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br></div></blockquote></div></blockquote></body></html>