Open openradar-mirror opened 7 years ago
Summary: The Core Team has lamented before that no public API should be provided that only takes Swift varargs (i.e., the Foo… pattern) because it prevents API composition.
Foo…
The os_log overlay for Swift does only this.
See also: https://github.com/apple/swift/blob/master/stdlib/public/SDK/os/os_log.swift#L23
Steps to Reproduce: Attempt to use os_log in API composition.
Expected Results: I can chain transformed argument lists into the overlay's os_log function.
Observed Results: I cannot.
Version: Xcode Version 9.0 beta 2 (9M137d)
Notes: See also: https://github.com/apple/swift/blob/master/stdlib/public/SDK/os/os_log.swift#L23
The extra function would have an identical implementation, just a different prototype. Heck, I might just PR it and reference this radar.
Allowing this kind of composition can allow developers to:
Configuration: N/A
- Product Version: Xcode Version 9.0 beta 2 (9M137d) Created: 2017-07-09T20:19:12.486240 Originated: 2017-07-09T16:18:00 Open Radar Link: http://www.openradar.me/33203955
Any follow up on this?
Description
Summary: The Core Team has lamented before that no public API should be provided that only takes Swift varargs (i.e., the
Foo…
pattern) because it prevents API composition.The os_log overlay for Swift does only this.
See also: https://github.com/apple/swift/blob/master/stdlib/public/SDK/os/os_log.swift#L23
Steps to Reproduce: Attempt to use os_log in API composition.
Expected Results: I can chain transformed argument lists into the overlay's os_log function.
Observed Results: I cannot.
Version: Xcode Version 9.0 beta 2 (9M137d)
Notes: See also: https://github.com/apple/swift/blob/master/stdlib/public/SDK/os/os_log.swift#L23
The extra function would have an identical implementation, just a different prototype. Heck, I might just PR it and reference this radar.
Allowing this kind of composition can allow developers to:
Configuration: N/A
- Product Version: Xcode Version 9.0 beta 2 (9M137d) Created: 2017-07-09T20:19:12.486240 Originated: 2017-07-09T16:18:00 Open Radar Link: http://www.openradar.me/33203955