A new feature in Swift 5 areDynamic Callable’s.We combine this with the relatedDynamic Member Lookupfeature to expose the filesystem and Unix shell commands asregular Swift objects and functions.
[…]
This is intended as a demo. It should work just fine, but in the name of error handling and proper Swift beauty, you might want to approach forking processes differently 🤓
[…]
An obvious limitation is that both features are statically typed. You can’t lookup one function thats returns an Int, and another function which returns a String. You have to tell the compiler in advance what type you expect.
[…]
Another limitation is that the reverse is not possible, i.e. you cannot lookup a Callable for a Swift function and dynamically invoke it via
m.dynamicallyCall(withArguments:).
Previously:Schema-less Database With Dynamic Swift,Exploring @dynamicMemberLookup.
BashLanguage DesignOpen SourceProgrammingSwift Programming Language
Black Friday
Blog
Archives
Tag Cloud
Top Posts
Recently Updated
RSS Feed ·Comments
Mastodon ·Twitter
Apple News
Trackback
Support this site viaPatreon.
Try my Mac apps: