Re: [swift-evolution] [Proposal] [Stage–2] `return` consistency for single-expressions

2017-02-19 Thread Rien via swift-evolution
> On 19 Feb 2017, at 19:14, Chris Lattner via swift-evolution > wrote: > > >> On Feb 18, 2017, at 9:59 PM, Kevin Nattinger wrote: >> >> >>> On Feb 18, 2017, at 7:33 PM, Chris Lattner via swift-evolution >>> wrote:

Re: [swift-evolution] [Proposal] [Stage–2] `return` consistency for single-expressions

2017-02-19 Thread Chris Lattner via swift-evolution
> On Feb 18, 2017, at 9:59 PM, Kevin Nattinger wrote: > > >> On Feb 18, 2017, at 7:33 PM, Chris Lattner via swift-evolution >> > wrote: >> >> >>> On Feb 17, 2017, at 12:20 AM, Adrian Zubarev via

Re: [swift-evolution] [Proposal] [Stage–2] `return` consistency for single-expressions

2017-02-18 Thread Adrian Zubarev via swift-evolution
I was a little afraid of that when I read Teds message first, but I thought I give it a try. This additional change doest feel heavy at all to me. My question is, when is the right time for this if not now? If not now than this won’t happen in Swift 4.1 either, and I highly doubt it for Swift

Re: [swift-evolution] [Proposal] [Stage–2] `return` consistency for single-expressions

2017-02-18 Thread Xiaodi Wu via swift-evolution
Ted Kremenek just wrote a post detailing Swift 4 stage 2. Here is the relevant part again [unable to increase the quotation level for unclear reasons, but the following is a verbatim copy from that message]: Timeline Stage 2 starts right now. All design work and discussion for stage 2 extends to

Re: [swift-evolution] [Proposal] [Stage–2] `return` consistency for single-expressions

2017-02-18 Thread Kevin Nattinger via swift-evolution
> On Feb 18, 2017, at 7:33 PM, Chris Lattner via swift-evolution > wrote: > > >> On Feb 17, 2017, at 12:20 AM, Adrian Zubarev via swift-evolution >> > wrote: >> >> I’d like to revive an additive proposal

Re: [swift-evolution] [Proposal] [Stage–2] `return` consistency for single-expressions

2017-02-18 Thread Chris Lattner via swift-evolution
> On Feb 17, 2017, at 12:20 AM, Adrian Zubarev via swift-evolution > wrote: > > I’d like to revive an additive proposal that couldn’t make it into Swift 3. > This proposal has a small improvement to the language compared to other big > features currently being

Re: [swift-evolution] [Proposal] [Stage–2] `return` consistency for single-expressions

2017-02-17 Thread Vladimir.S via swift-evolution
OK, just wanted to confirm that you are not suggesting to allow this in 'guard'. On 17.02.2017 18:57, Adrian Zubarev via swift-evolution wrote: Exactly, couldn’t say that any better. |guard| was part of this proposal in the first draft but was dropped due the same reasons Matthew just

Re: [swift-evolution] [Proposal] [Stage–2] `return` consistency for single-expressions

2017-02-17 Thread Adrian Zubarev via swift-evolution
Exactly, couldn’t say that any better. guard was part of this proposal in the first draft but was dropped due the same reasons Matthew just described. --  Adrian Zubarev Sent with Airmail Am 17. Februar 2017 um 15:46:33, Matthew Johnson (matt...@anandabits.com) schrieb: > On Feb 17, 2017,

Re: [swift-evolution] [Proposal] [Stage–2] `return` consistency for single-expressions

2017-02-17 Thread Matthew Johnson via swift-evolution
> On Feb 17, 2017, at 8:41 AM, Vladimir.S via swift-evolution > wrote: > > I think I like this, but what about guard? > > func f(x: Int) -> Int { > guard x > 0 else { return 0 } > ... > } > > vs > > func f(x: Int) -> Int { > guard x > 0 else { 0 } > …

Re: [swift-evolution] [Proposal] [Stage–2] `return` consistency for single-expressions

2017-02-17 Thread Vladimir.S via swift-evolution
I think I like this, but what about guard? func f(x: Int) -> Int { guard x > 0 else { return 0 } ... } vs func f(x: Int) -> Int { guard x > 0 else { 0 } ... } ? On 17.02.2017 11:20, Adrian Zubarev via swift-evolution wrote: I’d like to revive an additive proposal that

Re: [swift-evolution] [Proposal] [Stage–2] `return` consistency for single-expressions

2017-02-17 Thread Matthew Johnson via swift-evolution
+1. I have always thought this sugar should be consistent throughout the language. > On Feb 17, 2017, at 2:20 AM, Adrian Zubarev via swift-evolution > wrote: > > I’d like to revive an additive proposal that couldn’t make it into Swift 3. > This proposal has a

[swift-evolution] [Proposal] [Stage–2] `return` consistency for single-expressions

2017-02-17 Thread Adrian Zubarev via swift-evolution
I’d like to revive an additive proposal that couldn’t make it into Swift 3. This proposal has a small improvement to the language compared to other big features currently being proposed. It almost feels like a bug fix rather than a new feature, but it still needs a full and quick review