> On Dec 4, 2017, at 12:12 PM, Vladimir.S via swift-evolution 
> <swift-evolution@swift.org> wrote:
> 
> Probably the correct way to have dynamic calls in Swift is to 'mark' such 
> code with special flag and we need to find it. For example:
> 
> > // Python:        d = np.array([1, 2, 3], dtype="i2")
> > // Future Swift:  let d = np.@array([6, 7, 8], dtype: "i2")
> > // Future Swift:  let d = np@array([6, 7, 8], dtype: "i2")
> > // Future Swift:  let d = np:array([6, 7, 8], dtype: "i2")
> > // Future Swift:  let d = np.~array([6, 7, 8], dtype: "i2")
> > // Future Swift:  let d = np.@array([6, 7, 8], dtype: "i2")
> > // Future Swift:  let d = np."array"([6, 7, 8], dtype: "i2") // name of 
> > dynamic method is like just string, no any guarantee & we can have any 
> > needed symbol in string to express the details of target dynamic 
> > language(if needed)
> > // etc
> 
> Yes, IMO such code should be second class citizen in Swift.

This idea was discussed extensively upthread, and has been specifically 
addressed in the proposal:
https://gist.github.com/lattner/b016e1cf86c43732c8d82f90e5ae5438#increasing-visibility-of-dynamic-member-lookups
 
<https://gist.github.com/lattner/b016e1cf86c43732c8d82f90e5ae5438#increasing-visibility-of-dynamic-member-lookups>

-Chris

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to