Free functions generally work with autocomplete, however they have some disadvantages:
1. You can't easily find them when browsing with something like SwiftDoc or looking at headers via control-click in Xcode 2. Some of the compiler writers have commented that free functions slow the compiler down, and presumable therefore Xcode On Thu, 23 Feb 2017 at 6:02 am, Stephen Canon <[email protected]> wrote: > > On Feb 22, 2017, at 10:48 AM, David Sweeris via swift-evolution < > [email protected]> wrote: > > Eh, maybe… At least in Xcode, autocomplete works for free functions. I was > just thinking about how people who already know about “signum" would expect > it to work. Like if a mathematician sits down to write something in Swift, > are they more likely to try “signum(x)” or “x.signum” first? > > > Honestly, as a mathematician I think either one is fine. > > We like free functions in mathematics. x.signum is (slightly?) Swiftier. > Six of one, half dozen of the other, either one will be completely > satisfactory. > > – Steve > -- -- Howard.
_______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
