<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Also sending it to the list....<br><br>-- Erik<div><br></div></div><div><br>Begin forwarded message:<br><br></div><blockquote type="cite"><div><b>From:</b> Erik Verbruggen <<a href="mailto:erik.verbruggen@me.com">erik.verbruggen@me.com</a>><br><b>Date:</b> 30 oktober 2013 21:57:54 CET<br><b>To:</b> David Chisnall <<a href="mailto:David.Chisnall@cl.cam.ac.uk">David.Chisnall@cl.cam.ac.uk</a>><br><b>Subject:</b> <b>Re: [cfe-dev] Introducing attribute objc_pure_virtual_method</b><br><br></div></blockquote><blockquote type="cite"><div><span></span><br><span>-- Erik</span><br><span></span><br><blockquote type="cite"><span>On 30 okt. 2013, at 15:24, David Chisnall <<a href="mailto:David.Chisnall@cl.cam.ac.uk">David.Chisnall@cl.cam.ac.uk</a>> wrote:</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><blockquote type="cite"><span>On 30 Oct 2013, at 08:53, Jean-Daniel Dupas <<a href="mailto:devlists@shadowlab.org">devlists@shadowlab.org</a>> wrote:</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>My 2 cents (even if the feature does not end up in clang).</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>The concept of "pure virtual" may be clear for people common from C++, but I dont think this is the right wording to choose for Objective-C.</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>The Apple documentation never ever mentions the term virtual once for objective-c.  I think the word commonly used is "abstract" so a better name for this attribute could be objc_abstract_method .</span><br></blockquote></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>And even that is quite rare.  A more common notion in Objective-C is a primitive method (e.g. -length and -characterAtIndex: in NSString), which is then used to implement all of the others and must be implemented in subclasses.</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>It would be interesting to have a language feature that can check these (and make them more obvious - I've seen numerous instances of people skim-reading documentation and not identifying all of the methods that they must implement).  It would be cleaner, from a documentation standpoint, to be able to mark a protocol that a class implemented as requiring reimplementation in all subclasses.  Then it could be something that was both obvious in the documentation and checkable in the compiler.</span><br></blockquote><span></span><br><span>Maybe off-topic, or maybe I'm interpreting it wrong, but this looks like warning when -hash or -equals are not defined for a class. I would love to have this, as it's a common pitfall in multiple languages (Java comes to mind), but I can't come up with a good heuristic  that won't have many programmers pull their hair out because of compiler complaints. However, that might be my lack of imagination. </span><br><span></span><br><span>For class clusters: although I think it's a really cool concept, I'm not sure if it's useful/effective to cater for it. There are very, very few programmers who implement them, and when they do, they tend to know exactly what the implications are and what's going on. That said, a warning indicating that a certain method should be considered for overwriting is vey useful and would catch this case (well, everybody compiles with -Werror, right?)...</span><br><span></span><br><span>-- Erik. </span></div></blockquote></body></html>