<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><br class=""></div><div class=""><font face="Menlo" class="">There are different algorithms for Element==CGPoint, Element==[CGPoint], Element==[AreaPoint], etc…</font></div><div class=""><font face="Menlo" class=""><br class=""></font></div><div class=""><font face="Menlo" class="">Your second suggestion work:</font></div><div class=""><font face="Menlo" class=""><br class=""></font></div><div class=""><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="color: #ba2da2" class="">protocol</span> Inertial {</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span class="Apple-tab-span" style="white-space:pre">        </span><span style="color: #ba2da2" class="">func</span><span class="Apple-tab-span" style="white-space:pre">        </span>convexHull( <span style="color: #ba2da2" class="">_</span> t:<span style="color: #703daa" class="">AffineTransform</span>? ) -> [<span style="color: #703daa" class="">CGPoint</span>]</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(112, 61, 170); background-color: rgb(255, 255, 255);" class=""><span style="color: #000000" class=""><span class="Apple-tab-span" style="white-space:pre">        </span></span><span style="color: #ba2da2" class="">func</span><span style="color: #000000" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>area( </span><span style="color: #ba2da2" class="">_</span><span style="color: #000000" class=""> t:</span>AffineTransform<span style="color: #000000" class="">? ) -> </span>CGFloat</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span class="Apple-tab-span" style="white-space:pre">        </span><span style="color: #ba2da2" class="">func</span><span class="Apple-tab-span" style="white-space:pre">        </span>firstOrderMomentums( <span style="color: #ba2da2" class="">_</span> t:<span style="color: #703daa" class="">AffineTransform</span>? ) -> (x:<span style="color: #703daa" class="">CGFloat</span>,y:<span style="color: #703daa" class="">CGFloat</span>)</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span class="Apple-tab-span" style="white-space:pre">        </span><span style="color: #ba2da2" class="">func</span><span class="Apple-tab-span" style="white-space:pre">        </span>secondOrderMomentums( <span style="color: #ba2da2" class="">_</span> t:<span style="color: #703daa" class="">AffineTransform</span>? ) -> (xx:<span style="color: #703daa" class="">CGFloat</span>,xy:<span style="color: #703daa" class="">CGFloat</span>,yy:<span style="color: #703daa" class="">CGFloat</span>)</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">}</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="color: #ba2da2" class="">protocol</span> InertialElement {</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span class="Apple-tab-span" style="white-space:pre">        </span><span style="color: #ba2da2" class="">static</span> <span style="color: #ba2da2" class="">func</span> convexHull( elements:[<span style="color: #4f8187" class="">Self</span>], <span style="color: #ba2da2" class="">_</span> t: <span style="color: #703daa" class="">AffineTransform</span>?) -> [<span style="color: #703daa" class="">CGPoint</span>]</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span class="Apple-tab-span" style="white-space:pre">        </span><span style="color: #ba2da2" class="">static</span> <span style="color: #ba2da2" class="">func</span> area( elements:[<span style="color: #4f8187" class="">Self</span>],<span style="color: #ba2da2" class="">_</span> t: <span style="color: #703daa" class="">AffineTransform</span>?) -> <span style="color: #703daa" class="">CGFloat</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span class="Apple-tab-span" style="white-space:pre">        </span><span style="color: #ba2da2" class="">static</span> <span style="color: #ba2da2" class="">func</span> firstOrderMomentums( elements:[<span style="color: #4f8187" class="">Self</span>],<span style="color: #ba2da2" class="">_</span> t: <span style="color: #703daa" class="">AffineTransform</span>?) -> (x: <span style="color: #703daa" class="">CGFloat</span>, y: <span style="color: #703daa" class="">CGFloat</span>)</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span class="Apple-tab-span" style="white-space:pre">        </span><span style="color: #ba2da2" class="">static</span> <span style="color: #ba2da2" class="">func</span> secondOrderMomentums( elements:[<span style="color: #4f8187" class="">Self</span>],<span style="color: #ba2da2" class="">_</span> t: <span style="color: #703daa" class="">AffineTransform</span>?) -> (xx: <span style="color: #703daa" class="">CGFloat</span>, xy: <span style="color: #703daa" class="">CGFloat</span>, yy: <span style="color: #703daa" class="">CGFloat</span>)</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">}</div></div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135); background-color: rgb(255, 255, 255);" class=""><span style="color: #ba2da2" class="">extension</span><span style="color: #000000" class=""> </span><span style="color: #703daa" class="">Array</span><span style="color: #000000" class=""> : </span>Inertial<span style="color: #000000" class=""> </span><span style="color: #ba2da2" class="">where</span><span style="color: #000000" class=""> </span>Element<span style="color: #000000" class=""> : </span>InertialElement<span style="color: #000000" class=""> {</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span class="Apple-tab-span" style="white-space:pre">        </span><span style="color: #ba2da2" class="">func</span> convexHull(<span style="color: #ba2da2" class="">_</span> t: <span style="color: #703daa" class="">AffineTransform</span>?) -> [<span style="color: #703daa" class="">CGPoint</span>] {</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span class="Apple-tab-span" style="white-space:pre">                </span><span style="color: #ba2da2" class="">return</span> <span style="color: #703daa" class="">Element</span>.<span style="color: #31595d" class="">convexHull</span>(elements: <span style="color: #ba2da2" class="">self</span>, t)</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><p style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255); min-height: 16px;" class=""><span class="Apple-tab-span" style="white-space:pre">        </span><br class="webkit-block-placeholder"></p><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(112, 61, 170); background-color: rgb(255, 255, 255);" class=""><span style="color: #000000" class=""><span class="Apple-tab-span" style="white-space:pre">        </span></span><span style="color: #ba2da2" class="">func</span><span style="color: #000000" class=""> area(</span><span style="color: #ba2da2" class="">_</span><span style="color: #000000" class=""> t: </span>AffineTransform<span style="color: #000000" class="">?) -> </span>CGFloat<span style="color: #000000" class=""> {</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span class="Apple-tab-span" style="white-space:pre">                </span><span style="color: #ba2da2" class="">return</span> <span style="color: #703daa" class="">Element</span>.<span style="color: #31595d" class="">area</span>(elements: <span style="color: #ba2da2" class="">self</span>, t)</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><p style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255); min-height: 16px;" class=""><span class="Apple-tab-span" style="white-space:pre">        </span><br class="webkit-block-placeholder"></p><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span class="Apple-tab-span" style="white-space:pre">        </span><span style="color: #ba2da2" class="">func</span> firstOrderMomentums(<span style="color: #ba2da2" class="">_</span> t: <span style="color: #703daa" class="">AffineTransform</span>?) -> (x: <span style="color: #703daa" class="">CGFloat</span>, y: <span style="color: #703daa" class="">CGFloat</span>) {</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(49, 89, 93); background-color: rgb(255, 255, 255);" class=""><span style="color: #000000" class=""><span class="Apple-tab-span" style="white-space:pre">                </span></span><span style="color: #ba2da2" class="">return</span><span style="color: #000000" class=""> </span><span style="color: #703daa" class="">Element</span><span style="color: #000000" class="">.</span>firstOrderMomentums<span style="color: #000000" class="">(elements: </span><span style="color: #ba2da2" class="">self</span><span style="color: #000000" class="">, t)</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><p style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255); min-height: 16px;" class=""><span class="Apple-tab-span" style="white-space:pre">        </span><br class="webkit-block-placeholder"></p><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span class="Apple-tab-span" style="white-space:pre">        </span><span style="color: #ba2da2" class="">func</span> secondOrderMomentums(<span style="color: #ba2da2" class="">_</span> t: <span style="color: #703daa" class="">AffineTransform</span>?) -> (xx: <span style="color: #703daa" class="">CGFloat</span>, xy: <span style="color: #703daa" class="">CGFloat</span>, yy: <span style="color: #703daa" class="">CGFloat</span>) {</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(49, 89, 93); background-color: rgb(255, 255, 255);" class=""><span style="color: #000000" class=""><span class="Apple-tab-span" style="white-space:pre">                </span></span><span style="color: #ba2da2" class="">return</span><span style="color: #000000" class=""> </span><span style="color: #703daa" class="">Element</span><span style="color: #000000" class="">.</span>secondOrderMomentums<span style="color: #000000" class="">(elements: </span><span style="color: #ba2da2" class="">self</span><span style="color: #000000" class="">, t)</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">}</div></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">and than:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135); background-color: rgb(255, 255, 255);" class=""><span style="color: #ba2da2" class="">extension</span><span style="color: #000000" class=""> </span><span style="color: #703daa" class="">CGPoint</span><span style="color: #000000" class=""> : </span>InertialElement<span style="color: #000000" class=""> {</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span class="Apple-tab-span" style="white-space:pre">        </span><span style="color: #ba2da2" class="">static</span> <span style="color: #ba2da2" class="">func</span> convexHull( elements:[<span style="color: #703daa" class="">CGPoint</span>], <span style="color: #ba2da2" class="">_</span> t: <span style="color: #703daa" class="">AffineTransform</span>?) -> [<span style="color: #703daa" class="">CGPoint</span>] {</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span class="Apple-tab-span" style="white-space:pre">                </span><span style="color: #ba2da2" class="">return</span> <span style="color: #4f8187" class="">ConvexHull</span>.<span style="color: #31595d" class="">convexHull</span>( points:elements ).<span style="color: #3e1e81" class="">map</span> { $0 * t }</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><p style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255); min-height: 16px;" class=""><span class="Apple-tab-span" style="white-space:pre">        </span><br class="webkit-block-placeholder"></p><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span class="Apple-tab-span" style="white-space:pre">        </span><span style="color: #ba2da2" class="">static</span> <span style="color: #ba2da2" class="">func</span> area( elements:[<span style="color: #703daa" class="">CGPoint</span>],<span style="color: #ba2da2" class="">_</span> t: <span style="color: #703daa" class="">AffineTransform</span>?) -> <span style="color: #703daa" class="">CGFloat</span> {</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span class="Apple-tab-span" style="white-space:pre">                </span><span style="color: #ba2da2" class="">return</span> <span style="color: #4f8187" class="">InertialUti</span>.<span style="color: #31595d" class="">area</span>( polig: elements,t )</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><p style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255); min-height: 16px;" class=""><span class="Apple-tab-span" style="white-space:pre">        </span><br class="webkit-block-placeholder"></p><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span class="Apple-tab-span" style="white-space:pre">        </span><span style="color: #ba2da2" class="">static</span> <span style="color: #ba2da2" class="">func</span> firstOrderMomentums( elements:[<span style="color: #703daa" class="">CGPoint</span>],<span style="color: #ba2da2" class="">_</span> t: <span style="color: #703daa" class="">AffineTransform</span>?) -> (x: <span style="color: #703daa" class="">CGFloat</span>, y: <span style="color: #703daa" class="">CGFloat</span>) {</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span class="Apple-tab-span" style="white-space:pre">                </span><span style="color: #ba2da2" class="">return</span> <span style="color: #4f8187" class="">InertialUti</span>.<span style="color: #31595d" class="">firstOrderMomentums</span>( polig:elements,t )</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><p style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255); min-height: 16px;" class=""><span class="Apple-tab-span" style="white-space:pre">        </span><br class="webkit-block-placeholder"></p><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span class="Apple-tab-span" style="white-space:pre">        </span><span style="color: #ba2da2" class="">static</span> <span style="color: #ba2da2" class="">func</span> secondOrderMomentums( elements:[<span style="color: #703daa" class="">CGPoint</span>],<span style="color: #ba2da2" class="">_</span> t: <span style="color: #703daa" class="">AffineTransform</span>?) -> (xx: <span style="color: #703daa" class="">CGFloat</span>, xy: <span style="color: #703daa" class="">CGFloat</span>, yy: <span style="color: #703daa" class="">CGFloat</span>) {</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span class="Apple-tab-span" style="white-space:pre">                </span><span style="color: #ba2da2" class="">return</span> <span style="color: #4f8187" class="">InertialUti</span>.<span style="color: #31595d" class="">secondOrderMomentums</span>( polig:elements,t )</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">}</div></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><div style="margin: 0px; font-stretch: normal; line-height: normal; color: rgb(79, 129, 135);" class=""><span style="color: #ba2da2" class="">extension</span><span style="color: #000000" class=""> </span><span style="color: #703daa" class="">Array</span><span style="color: #000000" class=""> : </span>InertialElement<span style="color: #000000" class=""> </span><span style="color: #ba2da2" class="">where</span><span style="color: #000000" class=""> </span>Element<span style="color: #000000" class=""> == </span><span style="color: #703daa" class="">CGPoint</span><span style="color: #000000" class=""> {</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; color: rgb(79, 129, 135);" class=""><span style="color: #000000" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>...</span></div><div class=""><span style="color: #000000" class="">}</span></div></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><div style="margin: 0px; font-stretch: normal; line-height: normal; color: rgb(79, 129, 135);" class=""><span style="color: #ba2da2" class="">extension</span><span style="color: #000000" class=""> </span>AreaPoint<span style="color: #000000" class=""> : </span>InertialElement<span style="color: #000000" class=""> {</span></div><div class=""><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><div style="margin: 0px; font-stretch: normal; line-height: normal; color: rgb(79, 129, 135);" class=""><span style="color: rgb(0, 0, 0);" class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>...</span></div><div class="">}</div><div class=""><br class=""></div></div></div></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">etc...</div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><br class=""></div></div><div class=""><div class=""><font face="Menlo" class="">Thanks, Slava. :-)</font></div><div class=""><br class=""></div></div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);" class=""><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo;" class="">Antonino</div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><br class=""></div></div><div><blockquote type="cite" class=""><div class="">Il giorno 28 nov 2017, alle ore 23:17, Slava Pestov <<a href="mailto:spestov@apple.com" class="">spestov@apple.com</a>> ha scritto:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Antonio,<div class=""><br class=""></div><div class="">This is explicitly mentioned in the original proposal. We do not allow multiple conditional conformances to be defined for the same type. Instead, is it possible to express your conformance as follows?</div><div class=""><br class=""></div><div class="">extension Array : Intertial where Element : Inertial { … }</div><div class=""><br class=""></div><div class="">Or do you really need different algorithms for Element == CGPoint and Element == [CGPoint], with no conformance for Element == [[CGPoint]], etc?</div><div class=""><br class=""></div><div class="">If the latter, you could possibly have an InertialElement protocol or similar that CGPoint and [CGPoint] conform to, with a second level of dispatch to pick between the two cases.</div><div class=""><br class=""></div><div class="">Slava<br class=""><div class=""><br class=""></div></div></div></div></blockquote></div><br class=""></div></body></html>