<div dir="ltr">one solution is @requires_super(first|last). This cuts out "call me in the middle" but that is a worthwhile trade, in my opinion.</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 16, 2015 at 9:22 PM, Javier Soto via swift-evolution <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I'm not a fan of this feature because it encourages a type of API design that's really hard to ensure that it's used correctly. The biggest problem is the fact that often when a class expects or allows a method to be overriden, and super needs to be called, it expects the call to happen in a particular order: either before of after the implementation from the subclass. <br><br>So yes, this is missing from Obj-C, yes, this is important because UIKit, but going forward my feeling is that a language without this feature is a language that will force you to think about an alternative way to implement an API without this, and that'll probably be less error-prone. <br><div class="gmail_quote"><div><div class="h5"><div dir="ltr">On Wed, Dec 16, 2015 at 3:03 PM Tino Heth via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> wrote:<br></div></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div style="word-wrap:break-word"><div><blockquote type="cite"><div><div dir="ltr" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">Default behavior would require something like "unrequire" which seems odd.</div></div></blockquote></div></div><div style="word-wrap:break-word"><div><div>the keyword for requires_super is so odd, it doesn't even fit in a single word! ;-)</div><div>I think it is much easer to find a word for something that can be replaced completely than for "you have to call the implementation of the parent class"</div></div></div><div style="word-wrap:break-word"><div><br><blockquote type="cite"><div><div dir="ltr" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div><div>Also this would break a lot of existing code and migration can't be done automatically.</div></div></div></div></blockquote></div></div><div style="word-wrap:break-word"><div></div>Two parts:<div>What is a lot? I really don't think calling super hurts in many places.</div><div>Why shouldn't it be possible to migrate automatically? It might get complicated for compiled libs, but definitely possible.</div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=EmLgVGNgdilXys3cXWyAWvOFC2-2FejnHkMVv8PyEdfbpIiAM0sw8SMjmNpeDYfJaeBiBK-2BepRu7apL4KrlbvDgP-2Fqb5QKul7yZHL2m5H6Dn2-2FeB9gFlG6LM4B294z0bkqXKfaNERDK5UwZLPLO-2FdaF27cNWZ11JCQKVaGLyqFvWcuabeU0ppgsN7zCqTqdeGbPN9g-2Fd5v2-2BLqFmH9yCA8LvpcILqw-2FlnSzv9Wc05N6z4-3D" alt="" width="1" height="1" border="0" style="min-height:1px!important;width:1px!important;border-width:0!important;margin-top:0!important;margin-bottom:0!important;margin-right:0!important;margin-left:0!important;padding-top:0!important;padding-bottom:0!important;padding-right:0!important;padding-left:0!important">
</div></div></div><span class="">
_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</span></blockquote></div><span class="HOEnZb"><font color="#888888"><div dir="ltr">-- <br></div>Javier Soto
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=3FGfocPbgxkNkmje7djckg9Iw-2BGYY3X6RxJ1tkUXKCro3KPh8Esu-2FpH3F1VuahQb8u0LT79wTah0YPx-2F2jbMOEVOX0tZQHr7misqlS2APy-2BmP5zW0pXiEbyMqmlFa44j7-2Fecqv-2FVgrJjBO2aNHveOf6v-2FkCWYe5AFG2K30GfO-2FkUS7OAbjMu-2BlaJ0KrGXS4uN1TRyDxoEXHKK09j0xkMnS23GZX04IvAfLFzcsZSrYw-3D" alt="" width="1" height="1" border="0" style="min-height:1px!important;width:1px!important;border-width:0!important;margin-top:0!important;margin-bottom:0!important;margin-right:0!important;margin-left:0!important;padding-top:0!important;padding-bottom:0!important;padding-right:0!important;padding-left:0!important">
</font></span><br>_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
<br></blockquote></div><br></div>