[swift-evolution] [Proposal draff] abstract classes and methods

David Scrève david.screve at dlta-studio.com
Sat Jan 9 15:09:22 CST 2016


I’m not sure that we should remove required initializers because they handle a different semantic : a required initializer has a default implementation whereas abstract initializer does not.	

But I agree that required keyword is less useful if we introduce the abstract concept and I admit I do not have any real use case of this.

I think this should be introduced in another proposal where we also might discuss about the extensibility of required keyword to any method in classes.

David


> Le 9 janv. 2016 à 20:02, Chris Lattner <clattner at apple.com> a écrit :
> 
> 
>> On Jan 7, 2016, at 9:55 AM, David Scrève via swift-evolution <swift-evolution at swift.org> wrote:
>> 
>> # Abstract classes and methods
>> 
>> * Author(s): David Scrève
>> 
>> ## Introduction
>> 
>> When developing framework and reusable, we need to develop classes that are partially 
>> abstract with partial implementation. Protocol and protocol extensions provide this, but 
>> they cannot have attributes as classes have.
>> A partial class combines the behavior of a class with the requirement of implementing methods
>> in inherited class like protocols.
> 
> I tend to agree that adding abstract methods (and classes) is the right thing to do.  OOP is an important part of Swift, and is a great way for modeling certain classes of problems.
> 
> I wonder if we could simplify our initializer model if we had this, for example, could “required" initializers go away?
> 
> -Chris

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4233 bytes
Desc: not available
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160109/e2603a86/attachment.p7s>


More information about the swift-evolution mailing list