[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Obj-C - Categories on Protocols
From: |
Derek Fawcus |
Subject: |
Obj-C - Categories on Protocols |
Date: |
Sat, 20 Jun 2020 21:59:54 +0100 |
I recently read the ACM article on the history of Obj-C [1],
and noticed it indicated that the intended ability to create
a category on a protocol as never having shipped as a feature,
but that it did ship as a thing in Swift [2].
The references at the end of the ACM paper state:
"Extensions on Protocols allow programmers to add methods and their
implementations to a protocol which all conforming classes will
automatically gain. We refer specifically to the section of the
website describing Extensions on Protocols in Swift to document
that this functionality originally proposed for Objective-C in 1995
but never shipped finally became available in the Swift successor
language in 2014."
So I wonder, does this mean that the Apple Obj-C runtime happens to
include this mechanism, despite it not being exposed to the language,
or is it only provided by the Swift runtime?
DF
[1] https://dl.acm.org/doi/10.1145/3386332
(The origins of Objective-C at PPI/Stepstone and its evolution at NeXT)
[2] https://docs.swift.org/swift-book/LanguageGuide/Protocols.html#ID521
- Obj-C - Categories on Protocols,
Derek Fawcus <=