Avatar
omochimetaru 3/19/2019 3:48 AM
Hi all, @dan-zheng and I wrote a proposal to introduce static callables to Swift. This proposal is also available as a gist here. We'd love to hear your feedback. Introduce callables Proposal: SE-NNNN Authors: Richard Wei, Dan Zheng Review Manager: TBD Status: Implementati...
3:49 AM
おもしろそうな話題
3:49 AM
struct Adder { var base: Int call(_ x: Int) -> Int { return base + x } } let add3 = Adder(base: 3) add3(10) // => 13
3:50 AM
いわゆる関数オブジェクト、Swiftの型システム的にはnominalな関数型(現状はstructural only)とも言えそう