Re: [swift-evolution] [Draft] Tuple-Based Compound Optional Binding

2016-06-21 Thread Chris Lattner via swift-evolution
> On Jun 21, 2016, at 11:11 PM, Chris Lattner via swift-evolution > wrote: > > >> On Jun 12, 2016, at 4:46 AM, Brent Royal-Gordon > > wrote: >> >> When I suggested this syntax in the acceptance thread for SE-0099, Chris >> said it should be written up as a prop

Re: [swift-evolution] [Draft] Tuple-Based Compound Optional Binding

2016-06-21 Thread Chris Lattner via swift-evolution
> On Jun 12, 2016, at 4:46 AM, Brent Royal-Gordon > wrote: > > When I suggested this syntax in the acceptance thread for SE-0099, Chris said > it should be written up as a proposal. I'm sure this will get lost in the > WWDC shuffle, but here goes. Hi Brent, I’m sorry that I haven’t had time

Re: [swift-evolution] [Draft] Tuple-Based Compound Optional Binding

2016-06-16 Thread Patrick Smith via swift-evolution
I’m not really interested in a really rich language, just the most simple thing possible that lets me create rich apps. I like Vladimir’s description of there being more when you need it. (I guess what I am concerned about is complexity as a writer. I want everything to be as consistent and log

Re: [swift-evolution] [Draft] Tuple-Based Compound Optional Binding

2016-06-15 Thread L. Mihalkovic via swift-evolution
> On Jun 15, 2016, at 7:53 PM, Vladimir.S wrote: > >> On 15.06.2016 18:42, L. Mihalkovic via swift-evolution wrote: >> >> On Jun 15, 2016, at 5:04 PM, Austin Zheng > > wrote: >> >>> On Jun 14, 2016, at 7:12 AM, L. Mihalkovic via swift-evolution mailto:s

Re: [swift-evolution] [Draft] Tuple-Based Compound Optional Binding

2016-06-15 Thread Vladimir.S via swift-evolution
On 15.06.2016 18:42, L. Mihalkovic via swift-evolution wrote: On Jun 15, 2016, at 5:04 PM, Austin Zheng mailto:austinzh...@gmail.com>> wrote: On Jun 14, 2016, at 7:12 AM, L. Mihalkovic via swift-evolution mailto:swift-evolution@swift.org>> wrote: On Jun 14, 2016, at 11:31 AM, Patrick Smith

Re: [swift-evolution] [Draft] Tuple-Based Compound Optional Binding

2016-06-15 Thread L. Mihalkovic via swift-evolution
> On Jun 15, 2016, at 5:04 PM, Austin Zheng wrote: > > >> On Jun 14, 2016, at 7:12 AM, L. Mihalkovic via swift-evolution >> wrote: >> >> >> On Jun 14, 2016, at 11:31 AM, Patrick Smith via swift-evolution >> wrote: >> >>> Thanks Xiaodi. Interesting arguments there. It possibly seems a sha

Re: [swift-evolution] [Draft] Tuple-Based Compound Optional Binding

2016-06-15 Thread Austin Zheng via swift-evolution
> On Jun 14, 2016, at 7:12 AM, L. Mihalkovic via swift-evolution > wrote: > > > On Jun 14, 2016, at 11:31 AM, Patrick Smith via swift-evolution > mailto:swift-evolution@swift.org>> wrote: > >> Thanks Xiaodi. Interesting arguments there. It possibly seems a shame to me, >> because it has kno

Re: [swift-evolution] [Draft] Tuple-Based Compound Optional Binding

2016-06-14 Thread L. Mihalkovic via swift-evolution
;>> >>>> Or even as has often been requested, to keep the same name: >>>> >>>> guard let opt1? { >>>> ... >>>> } >>>> >>>> Multiples: >>>> >>>> guard let (opt1?, opt2?, opt3?) { >&g

Re: [swift-evolution] [Draft] Tuple-Based Compound Optional Binding

2016-06-14 Thread Patrick Smith via swift-evolution
, but it always has seemed like something shorter > and more self explanatory could be made for optionals. `?` in pattern > matching is a special syntax anyway, so why not make this common use case > easier? > > Patrick > > _ > From: Pyry Jahkol

Re: [swift-evolution] [Draft] Tuple-Based Compound Optional Binding

2016-06-13 Thread Xiaodi Wu via swift-evolution
y could be made for optionals. `?` in >> pattern matching is a special syntax anyway, so why not make this common >> use case easier? >> >> Patrick >> >> _ >> From: Pyry Jahkola via swift-evolution >> Sent: Sunday, June 12,

Re: [swift-evolution] [Draft] Tuple-Based Compound Optional Binding

2016-06-13 Thread Xiaodi Wu via swift-evolution
made for optionals. `?` in > pattern matching is a special syntax anyway, so why not make this common > use case easier? > > Patrick > > _____________ > From: Pyry Jahkola via swift-evolution > Sent: Sunday, June 12, 2016 10:04 PM > Subject: Re: [swift-evolution] [Dr

Re: [swift-evolution] [Draft] Tuple-Based Compound Optional Binding

2016-06-13 Thread Patrick Smith via swift-evolution
syntax anyway, so why not make this common use case easier? Patrick _ From: Pyry Jahkola via swift-evolution Sent: Sunday, June 12, 2016 10:04 PM Subject: Re: [swift-evolution] [Draft] Tuple-Based Compound Optional Binding To: Brent Royal-Gordon Cc: swift

Re: [swift-evolution] [Draft] Tuple-Based Compound Optional Binding

2016-06-13 Thread Haravikk via swift-evolution
+1 from me; I never considered that I could do this using pattern matching of a tuple, and as Brent says this is a nicer shorthand for introducing users to conditional binding in advance of teaching the finer details of pattern matching, plus I prefer it visually. > On 12 Jun 2016, at 12:46, Br

Re: [swift-evolution] [Draft] Tuple-Based Compound Optional Binding

2016-06-13 Thread Johan Jensen via swift-evolution
Currently `if case let (foo?, bar?, baz?) = (_foo(), _bar(), _baz())`, and _bar() returns nil, then `_baz()` will not be evaluated. On Mon, Jun 13, 2016 at 2:54 AM, Xiaodi Wu via swift-evolution < swift-evolution@swift.org> wrote: > What's the behavior currently with `if case let (foo?, bar?, baz

Re: [swift-evolution] [Draft] Tuple-Based Compound Optional Binding

2016-06-12 Thread Xiaodi Wu via swift-evolution
What's the behavior currently with `if case let (foo?, bar?, baz?)...`? On Sun, Jun 12, 2016 at 19:53 plx via swift-evolution < swift-evolution@swift.org> wrote: > This proposal should specify if the tuple is evaluated “eagerly” or as an > “early-exit”. > > That is, if we write `if let (foo,bar,ba

Re: [swift-evolution] [Draft] Tuple-Based Compound Optional Binding

2016-06-12 Thread plx via swift-evolution
This proposal should specify if the tuple is evaluated “eagerly” or as an “early-exit”. That is, if we write `if let (foo,bar,baz) = (_foo(), _bar(), _baz())`, and _bar() -> nil, will `_baz()` have been evaluated, or not? I’d use this feature either way, but the proposal should have a clear st

Re: [swift-evolution] [Draft] Tuple-Based Compound Optional Binding

2016-06-12 Thread Brent Royal-Gordon via swift-evolution
> It takes reaching the last section of the proposal to understand that there > is not real issue, that it does not add any functionality, and that it > basically amount to stylistic preference for something. It might be more > informative to start with that rather than leave it until the end.

Re: [swift-evolution] [Draft] Tuple-Based Compound Optional Binding

2016-06-12 Thread L. Mihalkovic via swift-evolution
It takes reaching the last section of the proposal to understand that there is not real issue, that it does not add any functionality, and that it basically amount to stylistic preference for something. It might be more informative to start with that rather than leave it until the end. > On Jun

Re: [swift-evolution] [Draft] Tuple-Based Compound Optional Binding

2016-06-12 Thread Xiaodi Wu via swift-evolution
On Sun, Jun 12, 2016 at 6:46 AM, Brent Royal-Gordon via swift-evolution < swift-evolution@swift.org> wrote: > When I suggested this syntax in the acceptance thread for SE-0099, Chris > said it should be written up as a proposal. I'm sure this will get lost in > the WWDC shuffle, but here goes. > T

Re: [swift-evolution] [Draft] Tuple-Based Compound Optional Binding

2016-06-12 Thread Brent Royal-Gordon via swift-evolution
>> guard let (a, b, c) = (opt1, opt2, opt3) else { ... } > > You mention `guard case` in the motivation, but I think for the uninitiated > reader it would be fair to point out that the following example already works > equivalently, with only a few extra characters: > > guard case let (a?, b?,

Re: [swift-evolution] [Draft] Tuple-Based Compound Optional Binding

2016-06-12 Thread Pyry Jahkola via swift-evolution
> On 12 Jun 2016, at 14:46, Brent Royal-Gordon via swift-evolution > wrote: > > guard let (a, b, c) = (opt1, opt2, opt3) else { ... } You mention `guard case` in the motivation, but I think for the uninitiated reader it would be fair to point out that the following example already works equi

[swift-evolution] [Draft] Tuple-Based Compound Optional Binding

2016-06-12 Thread Brent Royal-Gordon via swift-evolution
When I suggested this syntax in the acceptance thread for SE-0099, Chris said it should be written up as a proposal. I'm sure this will get lost in the WWDC shuffle, but here goes. Tuple-Based Compound Optional Binding Proposal: TBD Author: Brent Royal-Gordon Status: