Howdy,
There is already an accepted but not implemented proposal to determine whether
a module can be imported and conditionally compile accordingly.
https://github.com/apple/swift-evolution/blob/master/proposals/0075-import-test.md
While the accepted change is certainly not as compact as your n
I disagree. What about when you need to disambiguate?
Currently you’d need to use ‘Darwin.connect(...)’ or ‘Glibc.connect(…)’.
Merging them both in to one ‘Libc’ module would make that much easier.
> On 18 Oct 2016, at 01:07, Sean Alling via swift-evolution
> wrote:
>
> Yeah I saw that thread
Yeah I saw that thread. I think (a) this is a better solution and (b) this is
applicable for use cases other than specifically Glibc/Darwin.
-Sean
Sent from my iPhone
> On Oct 17, 2016, at 19:01, Saagar Jha wrote:
>
> I believe there was a draft to merge all the "Libc" modules; let me see if
I believe there was a draft to merge all the "Libc" modules; let me see if
I can find that.
On Mon, Oct 17, 2016 at 3:06 PM Sean Alling via swift-evolution <
swift-evolution@swift.org> wrote:
> *Description*
>
> In an effort to both (1) reduce boilerplate code, and (2) promote
> cross-platform re
Description
In an effort to both (1) reduce boilerplate code, and (2) promote
cross-platform reusability I propose that we implement the following Import
Conditional Operators:
`||` and `&&`
Currently, import conditionals must be implemented like so:
```
#if os(Linux) || os(FreeBSD)