-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Labels
needs bikesheddingConsensus on the general idea but exact syntax still needs bikesheddingConsensus on the general idea but exact syntax still needs bikeshedding
Milestone
Description
A point of confusion around the current protocol syntax has been the lack of clear distinction between required and provided members. Required members look just like data properties with no initializer.
Compare:
protocol ToString {
tag; // required
toString() { /* ... */ } // provided
}Additionally, as a side effect, there is no way to provide data properties — only to require them.
It seems far cleaner to explicitly denote this with a keyword, especially since in the majority of cases there is only one of these, so clarity trumps conciseness.
abstract would be more externally consistent with the same concept in other languages, requires is more human-friendly and internally consistent with the constructor API.
Metadata
Metadata
Assignees
Labels
needs bikesheddingConsensus on the general idea but exact syntax still needs bikesheddingConsensus on the general idea but exact syntax still needs bikeshedding