Re: [swift-evolution] Proposal: Allow #if to guard switch case clauses

2017-05-11 Thread Jon Shier via swift-evolution
Just wanted to add that I ran into the #if limitations when trying to port Alamofire to Linux, so any enhancements would be most welcome. There was a point where I had to duplicate an entire class because I couldn't use #if for just the parts I needed. Jon > On May 11, 2017, at 11:57

Re: [swift-evolution] Proposal: Allow #if to guard switch case clauses

2017-05-11 Thread rintaro ishizaki via swift-evolution
Thank you all! 2017-05-11 16:18 GMT+09:00 John McCall via swift-evolution < swift-evolution@swift.org>: > On May 11, 2017, at 1:45 AM, Nicholas Maccharoli via swift-evolution < > swift-evolution@swift.org> wrote: > I also strongly agree. > > I can think of no strong argument against this, was th

Re: [swift-evolution] Proposal: Allow #if to guard switch case clauses

2017-05-11 Thread John McCall via swift-evolution
> On May 11, 2017, at 1:45 AM, Nicholas Maccharoli via swift-evolution > wrote: > I also strongly agree. > > I can think of no strong argument against this, was this intentional at one > point or a compiler bug? The language design of #if is more complex than it is in C: it is part of the la

Re: [swift-evolution] Proposal: Allow #if to guard switch case clauses

2017-05-10 Thread Nicholas Maccharoli via swift-evolution
I also strongly agree. I can think of no strong argument against this, was this intentional at one point or a compiler bug? - Nick On Thu, May 11, 2017 at 2:37 PM, Chris Lattner via swift-evolution < swift-evolution@swift.org> wrote: > I agree with Jordan. > > -Chris > > On May 10, 2017, at 11

Re: [swift-evolution] Proposal: Allow #if to guard switch case clauses

2017-05-10 Thread Chris Lattner via swift-evolution
I agree with Jordan. -Chris > On May 10, 2017, at 11:47 AM, Jordan Rose via swift-evolution > wrote: > > I'm in favor, certainly. I'd personally say this wouldn't even need to go > through the full evolution process, but I'm not a core team member. > > Jordan > > >> On May 10, 2017, at 01:

Re: [swift-evolution] Proposal: Allow #if to guard switch case clauses

2017-05-10 Thread Kevin Nattinger via swift-evolution
I support this proposal 100%. In fact, I just ran into this use case. I’d support extending it to allow partial-case coverage (as long as it doesn’t cross a case: boundary, obviously), e.g. switch result { case .success(let object): doSomething(with: object) case .error(let error): #if

Re: [swift-evolution] Proposal: Allow #if to guard switch case clauses

2017-05-10 Thread Jordan Rose via swift-evolution
I'm in favor, certainly. I'd personally say this wouldn't even need to go through the full evolution process, but I'm not a core team member. Jordan > On May 10, 2017, at 01:32, rintaro ishizaki via swift-evolution > wrote: > > Hi evolution community, > > This proposal allows you to enclose

Re: [swift-evolution] Proposal: Allow #if to guard switch case clauses

2017-05-10 Thread Joe Groff via swift-evolution
Seems reasonable to me. > On May 10, 2017, at 1:32 AM, rintaro ishizaki via swift-evolution > wrote: > > Hi evolution community, > > This proposal allows you to enclose switch cases with #if directive. > Implementation: https://github.com/apple/swift/pull/9457 > This is one of the oldest SR i

Re: [swift-evolution] Proposal: Allow #if to guard switch case clauses

2017-05-10 Thread rintaro ishizaki via swift-evolution
Here's proposal link: https://github.com/rintaro/swift-evolution/blob/conditional-switch-case/proposals/-conditional-switch-case.md Fixed some typos, including my name :) 2017-05-10 17:32 GMT+09:00 rintaro ishizaki : > Hi evolution community, > > This proposal allows you to enclose switch ca

Re: [swift-evolution] Proposal: Allow #if to guard switch case clauses

2017-05-10 Thread Rien via swift-evolution
I hope this makes it through without generating a lot of extra discussion. I would love to have this in Swift 4, or the next regular update of xcode. Regards, Rien Site: http://balancingrock.nl Blog: http://swiftrien.blogspot.com Github: http://github.com/Balancingrock Project: http://swiftfire.

[swift-evolution] Proposal: Allow #if to guard switch case clauses

2017-05-10 Thread rintaro ishizaki via swift-evolution
Hi evolution community, This proposal allows you to enclose switch cases with #if directive. Implementation: https://github.com/apple/swift/pull/9457 This is one of the oldest SR issue: https://bugs.swift.org/browse/SR-2 https://bugs.swift.org/browse/SR-4196 Thanks! Rintaro Allow #if to guard s