> Just thinking out loud — ‘dynamic’ as an attribute on an object, allowing
> arbitrary method calls that are dispatched dynamically...
>
> let foo: @dynamic AnyObject = Foo()
> foo.someWeirdMethod()
>
> for thing in things {
> (thing as @dynamic).bar()
> }
>
> Dynamic as a type:
>
> let foo: dynamic = Foo()
> foo.someWeirdMethod()
>
> for thing in things {
> (thing as dynamic).bar()
> }
>
> Since the dynamic keyword defines a function that goes through runtime
> dispatch, the same very runtime dispatch that current AnyObject calls go
> through, it would make sense for the new stuff to be called something like
> dynamic or dynamic_binding or DynamicObject or whatever.
Or add a "here there be dragons" keyword on the expression, like the `try`
keyword. Straw syntax:
let foo = Foo()
yolo foo.someWeirdMethod()
--
Brent Royal-Gordon
Architechies
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution