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

Chris Lattner sabre at nondot.org
Sat Nov 11 12:03:35 CST 2017



> On Nov 11, 2017, at 2:19 AM, Tino Heth via swift-evolution <swift-evolution at swift.org> wrote:
> 
>> Example Usage
>> 
> 
> Swift is quite flexible on what can act as a closure — would it be allowed to use a dynamic callable in that context?
> I guess forwarding of
> 
> let closure: ([(String, Int)]) -> Int  = DynamicCallableType()
> 
> to the dynamicCall method of DynamicCallableType isn’t that hard, but wouldn’t it be odd if the value of closure changes when you leave out its type?

I’m not sure I understand what you’re getting at.  Can you show how this would work with the example in the motivation section?

-Chris


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


More information about the swift-evolution mailing list