[swift-evolution] [Pitch] Introduce user-defined dynamically "callable" types

Tino Heth 2th at gmx.de
Sat Nov 11 04:04:03 CST 2017


I generally dislike „protocol magic“, but I think in this case, there is also a precedence for an (imho) better way:
There’s no „Subscriptable“ protocol, and I would prefer callable types to be handled in the same way (afaics, subscripts are already used as „callable with different braces“ today in some cases).

You mention subscripts in „Alternatives considered“, but without an explanation why you don’t want a new declaration kind for dynamicCall — and I think it could co-exist with the orthogonal use case that you mention.

- Tino



More information about the swift-evolution mailing list