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

2016-06-22 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

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

2016-06-22 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

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

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 > wrote: On Jun 14, 2016, at 7:12 AM, L. Mihalkovic via swift-evolution >

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 >>

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 > > wrote: > >> Thanks Xiaodi. Interesting arguments there.

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

2016-06-14 Thread L. Mihalkovic via swift-evolution
t;>>> Multiples: >>>> >>>> guard let (opt1?, opt2?, opt3?) { >>>> ... >>>> } >>>> >>>> guard let (a?, b?, c?) = (opt1, opt2, opt3) { >>>> ... >>>> } >>>> >>>> So

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

2016-06-14 Thread Patrick Smith via swift-evolution
> > Patrick > > _____ > From: Pyry Jahkola via swift-evolution <swift-evolution@swift.org > <mailto:swift-evolution@swift.org>> > Sent: Sunday, June 12, 2016 10:04 PM > Subject: Re: [swift-evolution] [Draft] Tuple-Based Compound Optional Bi

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

2016-06-13 Thread Xiaodi Wu via swift-evolution
ore 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 Jahkola via swift-evolution <swift-e

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

2016-06-13 Thread Xiaodi Wu via swift-evolution
ptionals. `?` in > pattern matching is a special syntax anyway, so why not make this common > use case easier? > > Patrick > > _____ > From: Pyry Jahkola via swift-evolution <swift-evolution@swift.org> > Sent: Sunday, June 12, 2016 10:04 PM > Subject:

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 <swift-evolution@swift.org> Sent: Sunday, June 12, 2016 10:04 PM Subject: Re: [swift-evolution] [Draft] Tuple-Based Compound Optional B

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,

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?,

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

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

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

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. >

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

[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