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

Joe DeCapo snoogansbc at gmail.com
Sun Dec 3 23:47:40 CST 2017


> On Dec 3, 2017, at 11:35 PM, Letanyan Arumugam via swift-evolution <swift-evolution at swift.org> wrote:
> 
> I‘m not always the only one writing code (I could inherit a code base). I’ve used languages with only dynamic lookup before and knowing about something doesn’t always help especially when the documentation isn’t clear. Which is very possible in this case were libraries could be made by third parties.

I find it very hard to believe that Swift libraries are going to end up exposing this as a public api en masse. And if you inherit a code base where it's used internally, then it's fully within your power to wrap these dynamic calls in more strongly typed wrappers (you could even do this with third party libraries if necessary). You could just as easily inherit a code base where force unwrapping or IUOs are used irresponsibly, but this doesn't mean that these language features have no legitimate use. The solution is to refactor the code to use these idioms in the correct way.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20171203/158a9d44/attachment.html>


More information about the swift-evolution mailing list