Re: [swift-evolution] [Pitch] Eliminate tuples - unify member access syntax

2017-01-11 Thread Jamie Lemon via swift-evolution
I guess you don’t like Swift then after all? In my humble experience I have been involved in writing iOS apps since 2008 so seen a few changes - I have found it quicker and easier to write in Swift and just get things done better ( compared to Objective C ). For me - Swift is most welcome,

Re: [swift-evolution] [Pitch] Eliminate tuples - unify member access syntax

2017-01-11 Thread Freak Show via swift-evolution
I am almost not sure if this is a joke or not. That is an incredibly complicated looking hieroglyphic to dispatch a bit of code. I do this: - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { NSString* message = [NSString stringWithFormat:

Re: [swift-evolution] [Pitch] Eliminate tuples - unify member access syntax

2017-01-11 Thread André Videla via swift-evolution
> NSDictionary* switch = @{ > @[@0,@1]: ^{ NSLog(@"zero one"); }, > @[@1,@1]: ^{ NSLog(@"one one"); } > }; What you're describing here is only a narrow use of switch statements and doesn't handle the most powerful features of the switch statement: pattern matching. How would

Re: [swift-evolution] [Pitch] Eliminate tuples - unify member access syntax

2017-01-10 Thread Freak Show via swift-evolution
Pretty sure Array conforms to hashable and ==. > On Jan 10, 2017, at 23:43, David Sweeris wrote: > > > On Jan 11, 2017, at 01:29, David Sweeris via swift-evolution > > wrote: > >> >> On Jan 11, 2017, at

Re: [swift-evolution] [Pitch] Eliminate tuples - unify member access syntax

2017-01-10 Thread David Sweeris via swift-evolution
> On Jan 11, 2017, at 01:29, David Sweeris via swift-evolution > wrote: > > >> On Jan 11, 2017, at 01:11, Freak Show wrote: >> >> >>> On Jan 7, 2017, at 23:37, Derrick Ho wrote: >>> >>> I think pattern matching is the

Re: [swift-evolution] [Pitch] Eliminate tuples - unify member access syntax

2017-01-10 Thread David Sweeris via swift-evolution
> On Jan 11, 2017, at 01:11, Freak Show wrote: > > >> On Jan 7, 2017, at 23:37, Derrick Ho wrote: >> >> I think pattern matching is the most compelling reason to keep tuples. >> >> If they were gone, how would we replace the following? >> >>

Re: [swift-evolution] [Pitch] Eliminate tuples - unify member access syntax

2017-01-10 Thread Freak Show via swift-evolution
> On Jan 7, 2017, at 23:37, Derrick Ho wrote: > > I think pattern matching is the most compelling reason to keep tuples. > > If they were gone, how would we replace the following? > > switch (a, b) { > case (value1, value2): > case (value3, value4): > } I meant to

Re: [swift-evolution] [Pitch] Eliminate tuples - unify member access syntax

2017-01-09 Thread Austin Zheng via swift-evolution
The 'completing generics' document Doug put together has a section on this: https://github.com/apple/swift/blob/master/docs/GenericsManifesto.md#extensions-of-structural-types Austin > On Jan

Re: [swift-evolution] [Pitch] Eliminate tuples - unify member access syntax

2017-01-09 Thread Tyler Cloutier via swift-evolution
I’ll tell you it, though, it would be really nice to be able to add functions to tuples, just as they are done with structs. Perhaps there is a way to formalize tuples as unnamed or anonymous Structs? It would make them going away strictly by making them more powerful. > On Jan 8, 2017, at

Re: [swift-evolution] [Pitch] Eliminate tuples - unify member access syntax

2017-01-08 Thread Derrick Ho via swift-evolution
On Jan 7, 2017, at 23:37, Derrick Ho wrote: I think pattern matching is the most compelling reason to keep tuples. If they were gone, how would we replace the following? switch (a, b) { case (value1, value2): case (value3, value4): } I really have to ask. What do

Re: [swift-evolution] [Pitch] Eliminate tuples - unify member access syntax

2017-01-08 Thread Freak Show via swift-evolution
That would be fine. > On Jan 8, 2017, at 10:31, Micah Hainline wrote: > > Perhaps we could limit further discussion here to the idea the original > poster put forth about eliminating mixed named and unnamed tuple labels.

Re: [swift-evolution] [Pitch] Eliminate tuples - unify member access syntax

2017-01-08 Thread David Sweeris via swift-evolution
On Jan 8, 2017, at 09:33, Freak Show wrote: >> On Jan 7, 2017, at 22:51, David Sweeris wrote: > >> A really convenient way to pass around multiple values without having to >> bother with a formal struct. > > That's actually a big part of my concern.

Re: [swift-evolution] [Pitch] Eliminate tuples - unify member access syntax

2017-01-08 Thread Micah Hainline via swift-evolution
I feel that this thread has reached the predictable consensus conclusion that we should not eliminate tuples. Perhaps we could limit further discussion here to the idea the original poster put forth about eliminating mixed named and unnamed tuple labels. > On Jan 8, 2017, at 12:23 PM, Tony

Re: [swift-evolution] [Pitch] Eliminate tuples - unify member access syntax

2017-01-08 Thread Tony Allevato via swift-evolution
On Sun, Jan 8, 2017 at 9:33 AM Freak Show via swift-evolution < swift-evolution@swift.org> wrote: > On Jan 7, 2017, at 22:51, David Sweeris wrote: > A really convenient way to pass around multiple values without having to bother with a formal struct. That's actually a big

Re: [swift-evolution] [Pitch] Eliminate tuples - unify member access syntax

2017-01-08 Thread Freak Show via swift-evolution
> On Jan 7, 2017, at 22:51, David Sweeris wrote: > A really convenient way to pass around multiple values without having to > bother with a formal struct. That's actually a big part of my concern. The people on this list are, I'm certain, among the top programmers

Re: [swift-evolution] [Pitch] Eliminate tuples - unify member access syntax

2017-01-08 Thread Rod Brown via swift-evolution
Apart from your seeming distain for Swift, this proposal seems misguided to me, and to ignore some of the recent discussion around named parameters on tuples (which are currently in flux). Each of the types you mention each have clear, specific meanings. The following two are basic type system

Re: [swift-evolution] [Pitch] Eliminate tuples - unify member access syntax

2017-01-07 Thread Derrick Ho via swift-evolution
I think pattern matching is the most compelling reason to keep tuples. If they were gone, how would we replace the following? switch (a, b) { case (value1, value2): case (value3, value4): } On Sun, Jan 8, 2017 at 2:31 AM Derrick Ho wrote: > Don't remove tuples. > They make

Re: [swift-evolution] [Pitch] Eliminate tuples - unify member access syntax

2017-01-07 Thread Derrick Ho via swift-evolution
Don't remove tuples. They make it very convenient to pass multiple values around. Tuples use .0 instead of [0] which prevents any index out of bounds issues at compile time rather than at run time. Tuples should not adopt a dictionary style access because dictionaries imply nil for any key that

Re: [swift-evolution] [Pitch] Eliminate tuples - unify member access syntax

2017-01-07 Thread Robert Widmann via swift-evolution
Some simple questions: Say Tuples are deprecated and removed from the language: How would you go about pattern matching on multiple values in the same switch statement? What about pattern bindings for multiple values? When a function that takes more than one argument in a particular

Re: [swift-evolution] [Pitch] Eliminate tuples - unify member access syntax

2017-01-07 Thread David Sweeris via swift-evolution
> On Jan 7, 2017, at 19:34, Freak Show wrote: > > I think you're missing the forrest for the trees here.' > > Let me ask this: if you remove tuples from the language - what have you lost > - really? You can still say everything you could before. A really convenient

Re: [swift-evolution] [Pitch] Eliminate tuples - unify member access syntax

2017-01-07 Thread David Sweeris via swift-evolution
> On Jan 7, 2017, at 18:17, Freak Show via swift-evolution > wrote: > > It should also be noted that I am not a compiler or VM writer and I don't > give a fig how the language does things at the implementation level and this > is primarily a conceptual/syntactic

[swift-evolution] [Pitch] Eliminate tuples - unify member access syntax

2017-01-07 Thread Freak Show via swift-evolution
FWIW, I searched the previous proposals for any kind of mention of tuple and found nothing so forgive me if this has been discussed before. Swift currently has 5 ways to represent multi-values. Classes, structs, arrays, dictionaries, and tuples. Of these, classes are well established and