You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
protocolProtocolName{// declare a symbol which must be implementedthisMustBeImplemented;// and some methods that you get for free by implementing this protocolyouGetThisMethodForFree(...parameters){methodBody;}}classClassNameimplementsProtocolName{[ProtocolName.thisMustBeImplemented](){// this is the implementation for this class}}letinstance=newClassName;instance[ProtocolName.youGetThisMethodForFree]();
Champion: @michaelficarra
Repo: https://github.com/michaelficarra/proposal-first-class-protocols
Slides: https://docs.google.com/presentation/d/1WrvSyslnF-5VnPj3k3HRq8MRzuiSN1kQ6ENE1iUSmDU/edit?usp=sharing
First presented at the Sept 2017 meeting
Example
Implementation
The text was updated successfully, but these errors were encountered: