Movatterモバイル変換


[0]ホーム

URL:


Thursday,December27,2018

@dynamicCallable: Unix Tools as Swift Functions

Helge Heß:

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 viam.dynamicallyCall(withArguments:).

Previously:Schema-less Database With Dynamic Swift,Exploring @dynamicMemberLookup.

2 CommentsRSS ·Twitter


Michael Tsai - Blog - Kick-ass CLI Tools In Swift
January 22, 2019 5:06 PM

[…] Previously: @dynamicCallable: Unix Tools as Swift Functions. […]


Michael Tsai - Blog - Swift-ObjC Bridge Using @dynamicCallable
January 31, 2019 4:31 PM

[…] Previously: @dynamicCallable: Unix Tools as Swift Functions. […]

Leave a Comment

  

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:

DropDMGDropDMGDropDMG
EagleFilerEagleFilerEagleFiler
SpamSieveSpamSieveSpamSieve
ToothFairyToothFairyToothFairy
Copyright © 2000–2025Michael Tsai.

[8]ページ先頭

©2009-2025 Movatter.jp