Re: [swift-evolution] Enhanced Existentials

2017-01-03 Thread Rod Brown via swift-evolution
> On 3 Jan 2017, at 11:33 pm, David Hart via swift-evolution > wrote: > > Hello Mailing-list, > > I remember we discussed enhanced existentials heavily during the Swift 3 > timeframe but postponed it. I was wondering if we need to bring back for > discussion during Phase 1 or Phase 2? For ref

Re: [swift-evolution] [Pitch] Add the DefaultConstructible protocol to the standard library

2017-01-03 Thread Xiaodi Wu via swift-evolution
It's not, as far as I'm aware, working on master. In any case, though, Box(T()) would be just as ergonomic as Box() in Swift, which I don't think is the case in Rust, and the former is already possible without the need for conditional conformances. On Tue, Jan 3, 2017 at 16:57 David Sweeris via s

Re: [swift-evolution] [Pitch] Add the DefaultConstructible protocol to the standard library

2017-01-03 Thread David Sweeris via swift-evolution
> On Jan 3, 2017, at 11:31 AM, Alexis via swift-evolution > wrote: > > All in all, I don’t really have an opinion on whether Default makes sense for > Swift. Haven’t thought about it all that much. Swift is still missing the > features that make case 1 and 2 even viable motivations (condition

Re: [swift-evolution] [Pitch] Add the DefaultConstructible protocol to the standard library

2017-01-03 Thread Alexis via swift-evolution
Since people keep chiming in with “Rust has this”, I figured I should give the context for what’s up with Default in Rust. Disclaimer: I wasn’t around for the actual design of this API, but I worked with it a lot. So any justification I give is mostly my own posthoc perception of the purpose it

Re: [swift-evolution] Pattern matching with Arrays

2017-01-03 Thread Joe Groff via swift-evolution
> On Dec 22, 2016, at 7:43 PM, Robert Widmann wrote: > > Do you think there’s room for a more general Pattern Synonyms-like > feature that could > extend this to things that look tuple-y? We had a short conversation on > Twitter 'round

Re: [swift-evolution] Move placement of 'throws' statement

2017-01-03 Thread Derrick Ho via swift-evolution
John McCall +1 I agree. The placement should remain the same. On Tue, Jan 3, 2017 at 8:29 AM John McCall via swift-evolution < swift-evolution@swift.org> wrote: > On Dec 29, 2016, at 12:33 AM, Dave Abrahams via swift-evolution < > swift-evolution@swift.org> wrote: > > > on Wed Dec 28 2016, Chris L

Re: [swift-evolution] Should we relax restriction on closing over outer scope in class declarations?

2017-01-03 Thread Guillaume DIDIER via swift-evolution
If I understand correctly we are speaking of class definitions inside functions, so this doesn't affect classes defined at the global scope, which are what the beginner will first be told. Teaching them about defining classes in other places would then wait until they know more about closure, sc

Re: [swift-evolution] Replace named returns with `out` parameters?

2017-01-03 Thread Andrew Arnopoulos via swift-evolution
Adrian, I'm not entirely sure I understand. Are you looking for a way to pass parameters by reference? Because there is a way to do that with the inout keyword. If not would you mind providing a different example to elaborate? Again, I think I may be missing your point. -Andrew > On Dec 28, 2

Re: [swift-evolution] Move placement of 'throws' statement

2017-01-03 Thread John McCall via swift-evolution
> On Dec 29, 2016, at 12:33 AM, Dave Abrahams via swift-evolution > wrote: > > > on Wed Dec 28 2016, Chris Lattner > wrote: > >>> On Dec 28, 2016, at 9:52 AM, Dave Abrahams wrote: >>> it would be ambiguous to move the ‘throws’ keyword to the end of the >

Re: [swift-evolution] Switch statement tuple labels

2017-01-03 Thread Alexis via swift-evolution
If the input has labels, including them in the pattern has clear value: the compiler can check that the labels you expected are there, preventing value swapping bugs. Being able to omit the labels in the pattern is a reasonable convenience to avoid repeating yourself over and over. But being abl

[swift-evolution] Enhanced Existentials

2017-01-03 Thread David Hart via swift-evolution
Hello Mailing-list, I remember we discussed enhanced existentials heavily during the Swift 3 timeframe but postponed it. I was wondering if we need to bring back for discussion during Phase 1 or Phase 2? For reference, here is the proposal which Austin Zhend wrote which represented the culminat