<html><body><div>Proposal link: </div><div><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0026-abstract-classes-and-methods.md" class="" data-mce-href="https://github.com/apple/swift-evolution/blob/master/proposals/0026-abstract-classes-and-methods.md">https://github.com/apple/swift-evolution/blob/master/proposals/0026-abstract-classes-and-methods.md</a><br data-mce-bogus="1"></div><div><br data-mce-bogus="1"><div><blockquote type="cite"><div class="msg-quote" style="word-wrap: break-word;" data-mce-style="word-wrap: break-word;"><span class="Apple-tab-span" style="white-space: pre;" data-mce-style="white-space: pre;"> </span>• What is your evaluation of the proposal?</div></blockquote></div><div><span><br data-mce-bogus="1"></span></div><div><span>+1 but with the addition of a "protected" scope because for me the most important use case of abstract methods would be template methods where the method to be customized should not be part of the public interface. It has to be declared, though, so that the template method can reference it.<br></span></div><div><span>This is not possible with protocols, because all members of a protocol must have the same access scope as the protocol itself. Actually I'd like this to change in the future, so that e.g. the "protected" scope I'm proposing as extension to the current proposal would be usable in protocols as well. But this does not invalidate the need for abstract classes, because I think that as long as classes define types they should offer similar tools as protocols and not be second class citizens.<br data-mce-bogus="1"></span></div><div><span>Actually I think that the separation between protocols and classes is historical baggage in the first place and there should be only classes with real multiple inheritance which would put the discussion of POP vs. OOP at rest (I recently wrote a lengthy post on the Mixin thread discussing that: http://article.gmane.org/gmane.comp.lang.swift.evolution/8362).<br data-mce-bogus="1"></span></div><div><span><br data-mce-bogus="1"></span></div><div><span><br></span><blockquote type="cite"><div class="msg-quote" style="word-wrap: break-word;" data-mce-style="word-wrap: break-word;"><span class="Apple-tab-span" style="white-space: pre;" data-mce-style="white-space: pre;"> </span>• Is the problem being addressed significant enough to warrant a change to Swift?</div></blockquote></div><div><span><br data-mce-bogus="1"></span></div><div><span>Yes, template methods are a powerful tool in the design toolbox and should be supported by the language.</span></div><div><span>This requires abstract methods in combination with a "protected" scope.</span></div><div><span><br data-mce-bogus="1"></span></div><div><span><br></span><blockquote type="cite"><div class="msg-quote" style="word-wrap: break-word;" data-mce-style="word-wrap: break-word;"><span class="Apple-tab-span" style="white-space: pre;" data-mce-style="white-space: pre;"> </span>• Does this proposal fit well with the feel and direction of Swift?</div></blockquote></div><div><span><br data-mce-bogus="1"></span></div><div><span>Yes. While Swift leans heavily on protocols ("POP"), classes still have their place and define types just as protocols do, so they shouldn't be just second class citizens but do what they do well.</span></div><div><span><br data-mce-bogus="1"></span></div><div><span><br></span><blockquote type="cite"><div class="msg-quote" style="word-wrap: break-word;" data-mce-style="word-wrap: break-word;"><span class="Apple-tab-span" style="white-space: pre;" data-mce-style="white-space: pre;"> </span>• If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?</div></blockquote></div><div><span><br data-mce-bogus="1"></span></div><div><span>Java, C++, Ceylon, Scala, Eiffel all have abstract classes. They all have access scopes similar to "protected" to enable full use of abstract methods.</span></div><div><span><br data-mce-bogus="1"></span></div><div><span><br></span><blockquote type="cite"><div class="msg-quote" style="word-wrap: break-word;" data-mce-style="word-wrap: break-word;"><span class="Apple-tab-span" style="white-space: pre;" data-mce-style="white-space: pre;"> </span>• How much effort did you put into your review? A glance, a quick reading, or an in-depth study?</div></blockquote></div><div><span><br data-mce-bogus="1"></span></div><div><span>In-depth study. I took part in the discussion, as well.</span></div><div><span> <br></span>-Thorsten<br></div></div></body></html>