Re: [swift-evolution] Generic Subscripts

2017-01-11 Thread Douglas Gregor via swift-evolution
Sent from my iPhone > On Jan 11, 2017, at 11:05 PM, Chris Eidhof via swift-evolution > wrote: > > Okay, > > I agree that throwing subscripts would be great to have. Likewise, > generic(and maybe even throwing) properties could be useful. However, I think > that

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

2017-01-11 Thread Russ Bishop via swift-evolution
> On Jan 11, 2017, at 10:35 AM, Erica Sadun wrote: > >> >> On Jan 10, 2017, at 10:35 PM, Russ Bishop via swift-evolution >> > wrote: >> >> >>> On Dec 28, 2016, at 8:11 PM, Chris Lattner via swift-evolution

Re: [swift-evolution] Generic Subscripts

2017-01-11 Thread Chris Eidhof via swift-evolution
Okay, I agree that throwing subscripts would be great to have. Likewise, generic(and maybe even throwing) properties could be useful. However, I think that for this proposal, it makes more sense to focus on just generic subscripts, and mention throwing subscripts as "future improvements"? On

Re: [swift-evolution] Allow ' in variable/constant names?

2017-01-11 Thread Tony Allevato via swift-evolution
This particular case doesn't quite relate to the URL literal/regex discussion, which would require a complex new static evaluation feature. For this, the compiler *already has* logic to determine whether a string literal is

Re: [swift-evolution] Allow ' in variable/constant names?

2017-01-11 Thread David Sweeris via swift-evolution
> On Jan 11, 2017, at 23:12, Tony Allevato wrote: > > > >> On Wed, Jan 11, 2017 at 6:46 PM Jay Abbott via swift-evolution >> wrote: >> As Rob Mayoff pointed out, you can use MODIFIER LETTER PRIME - or PRIME, >> DOUBLE PRIME, and TRIPLE

Re: [swift-evolution] Allow ' in variable/constant names?

2017-01-11 Thread Tony Allevato via swift-evolution
On Wed, Jan 11, 2017 at 6:46 PM Jay Abbott via swift-evolution < swift-evolution@swift.org> wrote: > As Rob Mayoff pointed out, you can use MODIFIER LETTER PRIME - or PRIME, > DOUBLE PRIME, and TRIPLE PRIME - which makes more sense than an apostrophe. > Now if only there were a keyboard that had

Re: [swift-evolution] Allow ' in variable/constant names?

2017-01-11 Thread Joe Groff via swift-evolution
> On Jan 11, 2017, at 2:07 PM, David Sweeris wrote: > >> >> On Jan 11, 2017, at 15:41, Joe Groff via swift-evolution >> wrote: >> >> >>> On Jan 11, 2017, at 5:16 AM, Charlie Monroe via swift-evolution >>> wrote:

Re: [swift-evolution] Allow ' in variable/constant names?

2017-01-11 Thread T.J. Usiyan via swift-evolution
Please yes, if reasonably possible. I can see how it might not be though. On Wed, Jan 11, 2017 at 7:46 PM, Jay Abbott via swift-evolution < swift-evolution@swift.org> wrote: > As Rob Mayoff pointed out, you can use MODIFIER LETTER PRIME - or PRIME, > DOUBLE PRIME, and TRIPLE PRIME - which makes

Re: [swift-evolution] Generic Subscripts

2017-01-11 Thread Slava Pestov via swift-evolution
> On Jan 11, 2017, at 10:53 AM, Matthew Johnson via swift-evolution > wrote: > >> >> On Jan 11, 2017, at 12:32 PM, Erica Sadun via swift-evolution >> > wrote: >> >> >>> On Jan 11, 2017, at 12:26 AM,

Re: [swift-evolution] Allow ' in variable/constant names?

2017-01-11 Thread Jay Abbott via swift-evolution
As Rob Mayoff pointed out, you can use MODIFIER LETTER PRIME - or PRIME, DOUBLE PRIME, and TRIPLE PRIME - which makes more sense than an apostrophe. Now if only there were a keyboard that had a touch-screen at the top which could be used for typing context-sensitive characters that would otherwise

Re: [swift-evolution] Consolidate Code for Each Case in Enum

2017-01-11 Thread Jay Abbott via swift-evolution
I like the idea behind this, but I think the proposed syntax abuses extension, which applies to types not individual cases. Putting the code outside the enum also seems wrong, and it’s difficult to see how the compiler would handle it, in particular ensuring exhaustiveness. So I have come up with

Re: [swift-evolution] Allow ' in variable/constant names?

2017-01-11 Thread David Sweeris via swift-evolution
> On Jan 11, 2017, at 15:41, Joe Groff via swift-evolution > wrote: > > >> On Jan 11, 2017, at 5:16 AM, Charlie Monroe via swift-evolution >> wrote: >> >> -1. Why? Why not use foo2 instead? Is ' so much better? >> >> Instead, I'd

Re: [swift-evolution] Best way to handle escaping function that might throw

2017-01-11 Thread Howard Lovatt via swift-evolution
Another possibility, other than generics, would be to drop rethrows all together and have the compiler infer if a throw is possible or not, including: struct FStore { let f: () throws -> Void func call() throws { try f() } } The compiler can make two versions, one if f

Re: [swift-evolution] Consolidate Code for Each Case in Enum

2017-01-11 Thread David Sweeris via swift-evolution
Sent from my iPhone > On Jan 11, 2017, at 14:57, Anton Zhilin via swift-evolution > wrote: > > Wouldn’t protocols be a better solution in this case? If little to no logic > can be shared between enum cases, why have the enum in the first place? > > Your variant:

Re: [swift-evolution] Allow ' in variable/constant names?

2017-01-11 Thread Joe Groff via swift-evolution
> On Jan 11, 2017, at 5:16 AM, Charlie Monroe via swift-evolution > wrote: > > -1. Why? Why not use foo2 instead? Is ' so much better? > > Instead, I'd personally love better character support in Swift in the future > and allow a Character literals using ' - just

Re: [swift-evolution] Consolidate Code for Each Case in Enum

2017-01-11 Thread Anton Zhilin via swift-evolution
Wouldn’t protocols be a better solution in this case? If little to no logic can be shared between enum cases, why have the enum in the first place? Your variant: protocol State { mutating func react(to event: Event) } enum AuthenticationState: State, CustomStringConvertible { case

Re: [swift-evolution] Update on the Swift Project Lead

2017-01-11 Thread James Hillhouse via swift-evolution
Chris, While recognizing that change is the only universal constant, still I couldn't help but feel sad at the announcement of your departure from Apple. Thank you for all you helped accomplish there. I hope that whatever endeavors you pursue are always intellectually fulfilling. Jim

Re: [swift-evolution] Update on the Swift Project Lead

2017-01-11 Thread Muse M via swift-evolution
Tesla cars is now type-safe. On Thu, Jan 12, 2017 at 3:21 AM, Derrick Ho via swift-evolution < swift-evolution@swift.org> wrote: > Have fun working at Tesla Mr Chris Lattner! > > I look forward to seeing tesla car apps that can be written in swift. > > On Wed, Jan 11, 2017 at 1:22 PM Karl Wagner

Re: [swift-evolution] Generic Subscripts

2017-01-11 Thread John McCall via swift-evolution
> On Jan 11, 2017, at 1:32 PM, Erica Sadun via swift-evolution > wrote: >> On Jan 11, 2017, at 12:26 AM, Chris Lattner via swift-evolution >> > wrote: >> >> On Jan 10, 2017, at 11:40 AM, Douglas Gregor via

Re: [swift-evolution] Update on the Swift Project Lead

2017-01-11 Thread Derrick Ho via swift-evolution
Have fun working at Tesla Mr Chris Lattner! I look forward to seeing tesla car apps that can be written in swift. On Wed, Jan 11, 2017 at 1:22 PM Karl Wagner via swift-evolution < swift-evolution@swift.org> wrote: > > > On 11 Jan 2017, at 18:18, John Pratt via swift-evolution < >

Re: [swift-evolution] Generic Subscripts

2017-01-11 Thread Matthew Johnson via swift-evolution
> On Jan 11, 2017, at 12:32 PM, Erica Sadun via swift-evolution > wrote: > > >> On Jan 11, 2017, at 12:26 AM, Chris Lattner via swift-evolution >> > wrote: >> >> On Jan 10, 2017, at 11:40 AM, Douglas

Re: [swift-evolution] Generic Subscripts

2017-01-11 Thread Douglas Gregor via swift-evolution
> On Jan 11, 2017, at 10:32 AM, Erica Sadun wrote: > > >> On Jan 11, 2017, at 12:26 AM, Chris Lattner via swift-evolution >> > wrote: >> >> On Jan 10, 2017, at 11:40 AM, Douglas Gregor via swift-evolution >>

Re: [swift-evolution] Generic Subscripts

2017-01-11 Thread Erica Sadun via swift-evolution
> On Jan 11, 2017, at 12:26 AM, Chris Lattner via swift-evolution > wrote: > > On Jan 10, 2017, at 11:40 AM, Douglas Gregor via swift-evolution > > wrote: >>> On Jan 10, 2017, at 10:34 AM, Michael Ilseman

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

2017-01-11 Thread Erica Sadun via swift-evolution
> On Jan 10, 2017, at 10:35 PM, Russ Bishop via swift-evolution > wrote: > > >> On Dec 28, 2016, at 8:11 PM, Chris Lattner via swift-evolution >> > wrote: >> >> >>> On Dec 28, 2016, at 7:47 PM, Xiaodi

Re: [swift-evolution] Update on the Swift Project Lead

2017-01-11 Thread Karl Wagner via swift-evolution
> On 11 Jan 2017, at 18:18, John Pratt via swift-evolution > wrote: > > > You are just going to drop this entire project, that has its name associated > with you, > for a very fierce competitor? > That’s pretty insulting to everybody else who works on the project

Re: [swift-evolution] Allow ' in variable/constant names?

2017-01-11 Thread Rob Mayoff via swift-evolution
It's not as easy to type, but you can already use U+02B9 MODIFIER LETTER PRIME for this purpose. Swift accepts this: let x = 1 let xʹ = x + 1 let xʹʹ = xʹ + 1 let xʹʹʹ = xʹʹ + 1 On Wed, Jan 11, 2017 at 7:08 AM, Tuur Anton via swift-evolution < swift-evolution@swift.org> wrote: > I often have

Re: [swift-evolution] Update on the Swift Project Lead

2017-01-11 Thread Charles Srstka via swift-evolution
Is this really necessary? Charles > On Jan 11, 2017, at 11:18 AM, John Pratt via swift-evolution > wrote: > > You are just going to drop this entire project, that has its name associated > with you, > for a very fierce competitor? > > However capable Ted Kremenek

[swift-evolution] Update on the Swift Project Lead

2017-01-11 Thread John Pratt via swift-evolution
You are just going to drop this entire project, that has its name associated with you, for a very fierce competitor? However capable Ted Kremenek is, and I am sure that is, you have collectively decided to break this programming language every year or so. Who is going to get behind this

Re: [swift-evolution] Consolidate Code for Each Case in Enum

2017-01-11 Thread Tony Allevato via swift-evolution
I'll summarize my thoughts for now, after thinking about it for a bit longer: Plusses: + In some cases it's nicer to have the ability to group functionality at each case rather than spread across methods lower in the type definition. I've written enums that were like state machines where being

Re: [swift-evolution] Allow ' in variable/constant names?

2017-01-11 Thread Charlie Monroe via swift-evolution
> On Jan 11, 2017, at 3:55 PM, Ben Rimmington wrote: > > >> On 11 Jan 2017, at 13:16, Charlie Monroe wrote: >> >> Instead, I'd personally love better character support in Swift in the future >> and allow a Character literals using ' - just like in C, except with

Re: [swift-evolution] Consolidate Code for Each Case in Enum

2017-01-11 Thread David Sweeris via swift-evolution
> On Jan 11, 2017, at 08:48, Derrick Ho via swift-evolution > wrote: > > Interesting proposal Tim. So instead of repeating the enum cases multiple > times we repeat the functions multiple times? > > I feel like this merely flipping the complexity but not really

Re: [swift-evolution] Allow ' in variable/constant names?

2017-01-11 Thread Ben Rimmington via swift-evolution
> On 11 Jan 2017, at 13:16, Charlie Monroe wrote: > > Instead, I'd personally love better character support in Swift in the future > and allow a Character literals using ' - just like in C, except with Unicode > support: > > let myChar = 'x' // Character > let myChar2 = '∃' // Character > let

Re: [swift-evolution] Allow ' in variable/constant names?

2017-01-11 Thread David Sweeris via swift-evolution
> On Jan 11, 2017, at 07:43, Karl Wagner via swift-evolution > wrote: > > >> On 11 Jan 2017, at 14:08, Tuur Anton via swift-evolution >> wrote: >> >> I often have related variables. Would be nice to just add ' like I can in >> Haskell:

Re: [swift-evolution] Consolidate Code for Each Case in Enum

2017-01-11 Thread Derrick Ho via swift-evolution
Interesting proposal Tim. So instead of repeating the enum cases multiple times we repeat the functions multiple times? I feel like this merely flipping the complexity but not really getting rid of it. On Tue, Jan 10, 2017 at 8:08 PM Tim Shadel via swift-evolution < swift-evolution@swift.org>

Re: [swift-evolution] Update on the Swift Project Lead

2017-01-11 Thread Derrick Ho via swift-evolution
Thanks Chris! Thanks to yours work we got an improved objc and swift. On Wed, Jan 11, 2017 at 4:33 AM Georgios Moschovitis via swift-evolution < swift-evolution@swift.org> wrote: > Good news for Chris and Ted, I guess, congrats guys :) > > I am wondering, what’s the future of Playgrounds, now

Re: [swift-evolution] Allow ' in variable/constant names?

2017-01-11 Thread Karl Wagner via swift-evolution
> On 11 Jan 2017, at 14:08, Tuur Anton via swift-evolution > wrote: > > I often have related variables. Would be nice to just add ' like I can in > Haskell: > > let foo = "asdf" > let foo' = "asdf2" > > What do you think? > >

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] Allow ' in variable/constant names?

2017-01-11 Thread Charlie Monroe via swift-evolution
-1. Why? Why not use foo2 instead? Is ' so much better? Instead, I'd personally love better character support in Swift in the future and allow a Character literals using ' - just like in C, except with Unicode support: let myChar = 'x' // Character let myChar2 = '∃' // Character let myChar3 =

[swift-evolution] Allow ' in variable/constant names?

2017-01-11 Thread Tuur Anton via swift-evolution
I often have related variables. Would be nice to just add ' like I can in Haskell: let foo  = "asdf"let foo' = "asdf2" What do you think? ___ swift-evolution mailing list swift-evolution@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution

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] Update on the Swift Project Lead

2017-01-11 Thread Georgios Moschovitis via swift-evolution
Good news for Chris and Ted, I guess, congrats guys :) I am wondering, what’s the future of Playgrounds, now that it’s main ‘driver’ left Apple? Playgrounds is definitely one early killer app for Swift, it would be a pity for the project to stagnate. -g. PS: I am also wondering if Tesla will

Re: [swift-evolution] Update on the Swift Project Lead

2017-01-11 Thread Jérôme Duquennoy via swift-evolution
Well, that is a big big piece of news ! I want to thank you a lot for all you did on that project Chris. I consider Swift is the smartest and greatest project that came out of Apple those last years. Smartest because it feel like this is one of the few project of the company that actually kept

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