[swift-evolution] Proposal: Introduce User-defined "Dynamic Member Lookup" Types

Letanyan Arumugam letanyan.a at gmail.com
Wed Dec 6 17:46:27 CST 2017


> On 06 Dec 2017, at 20:54, Joe DeCapo via swift-evolution <swift-evolution at swift.org> wrote:
> 
> 
>> On Dec 6, 2017, at 12:39 PM, Thorsten Seitz via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
>> 
>> IUO is Swift’s equivalent to a null pointer and those are a _hole_ in the type system (this applies to all type systems having an equivalent to the null pointer). That is why such types are marked with "!“ in Swift.
>> This does not mean that Swift has no type system but that it’s type system has carefully marked holes.
> 
> But the types are only marked with "!" at the declaration site, just as types conforming to DynamicMemberLookup and DynamicCallable would be marked at the declaration site. There's no more indication at the call site that something is an IUO than there would be for something conforming to these protocols. They both require inspecting the type itself.

But IUO’s are marked with an “!” to differentiate it from a normal type, where as DynamicMemberLookup is just a normal protocol conformance. I would be curious as to what you think of this idea [1]? Would this still be too much of a constraint just to make sure that when people use this they’re explicitly aware of what they’re doing?


[1]: https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20171204/042015.html 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20171207/c3f1ce43/attachment.html>


More information about the swift-evolution mailing list