Re: [swift-evolution] Nil-rejection operator

2017-02-09 Thread Jack Newcombe via swift-evolution
While this is nice, it adds ambiguity to the nil-coalescing operator. For example, when using nil-coalescing with a wrapped error value and an unwrapped error value as operands: let optionalError: Errors? = nil let result = optionalError ?? Errors.generic The above will result in an

Re: [swift-evolution] Class and Subclass Existentials (Round 2)

2017-02-09 Thread Hooman Mehr via swift-evolution
> On Feb 9, 2017, at 10:47 AM, Joe Groff via swift-evolution > wrote: >> On Feb 9, 2017, at 4:26 AM, Step Christopher via swift-evolution >> > wrote: >> Looks good. Minor comments below: >> The typealias

Re: [swift-evolution] Class and Subclass Existentials (Round 2)

2017-02-09 Thread David Hart via swift-evolution
> On 9 Feb 2017, at 20:43, Matthew Johnson via swift-evolution > wrote: > > > > Sent from my iPad > >> On Feb 9, 2017, at 1:30 PM, Hooman Mehr via swift-evolution >> wrote: >> >> On Feb 9, 2017, at 10:47 AM, Joe Groff via

Re: [swift-evolution] Nil-rejection operator

2017-02-09 Thread Hooman Mehr via swift-evolution
Two more tiny overloads is all takes to fix it: func ??(lhs: T?, rhs: T) -> T { if let lhs = lhs { return lhs } else { return rhs } } func ??(lhs: T?, rhs: U) -> Error { if let lhs = lhs { return lhs } else { return rhs } } > On Feb 9, 2017, at 12:01 PM, Jack Newcombe

Re: [swift-evolution] Class and Subclass Existentials (Round 2)

2017-02-09 Thread Matthew Johnson via swift-evolution
> On Feb 9, 2017, at 2:44 PM, David Hart wrote: > > > On 9 Feb 2017, at 20:43, Matthew Johnson via swift-evolution > > wrote: > >> >> >> Sent from my iPad >> >> On Feb 9, 2017, at 1:30 PM, Hooman Mehr via

Re: [swift-evolution] Class and Subclass Existentials (Round 2)

2017-02-09 Thread Matthew Johnson via swift-evolution
Sent from my iPad > On Feb 9, 2017, at 1:30 PM, Hooman Mehr via swift-evolution > wrote: > > >>> On Feb 9, 2017, at 10:47 AM, Joe Groff via swift-evolution >>> wrote: >>> On Feb 9, 2017, at 4:26 AM, Step Christopher via swift-evolution

Re: [swift-evolution] Nil-rejection operator

2017-02-09 Thread Jack Newcombe via swift-evolution
This can actually be accomplished now using a closure: let value = optionalValue ?? { throw CustomError.failure }() However, this adds a layer of indirection that I’m not keen on and lacks the readability and maintainability of a well-defined operator. The problem with changing the

Re: [swift-evolution] Nil-rejection operator

2017-02-09 Thread Rob Mayoff via swift-evolution
On Thu, Feb 9, 2017 at 2:25 PM, Haravikk via swift-evolution < swift-evolution@swift.org> wrote: > I wonder if an alternative to the original proposal might be to allow > throw on the right hand side? So you could do: > > let y = x ?? throw myError > > You can do this today: extension Error {

Re: [swift-evolution] [swift-users] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread Joshua Alvarado via swift-evolution
The decision to move from the mailing list may have surprised many but the discussion on it has been ongoing very strong. Sorry you feel like you didn't get to voice your opinion which I believe everyone should have the opportunity to. I think many agree that email has it's perks on iPhone and

Re: [swift-evolution] Strings in Swift 4

2017-02-09 Thread Dave Abrahams via swift-evolution
on Thu Feb 09 2017, "Ted F.A. van Gaalen" wrote: > Hello Shawn > Just google with any programming language name and “string manipulation” > and you have enough reading for a week or so :o) > TedvG That truly doesn't answer the question. It's not, “why do people index strings with integers

Re: [swift-evolution] Strings in Swift 4

2017-02-09 Thread Hooman Mehr via swift-evolution
> On Feb 9, 2017, at 3:11 PM, Dave Abrahams wrote: > > > on Thu Feb 09 2017, "Ted F.A. van Gaalen" wrote: > >> Hello Shawn >> Just google with any programming language name and “string manipulation” >> and you have enough reading for a week or so :o) >> TedvG > > That

Re: [swift-evolution] [swift-users] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread Ted Kremenek via swift-evolution
> On Feb 9, 2017, at 4:09 PM, Matthew Johnson wrote: > > >> On Feb 9, 2017, at 6:04 PM, Ted Kremenek > > wrote: >> >> >>> On Feb 9, 2017, at 3:52 PM, Ted Kremenek via swift-users >>>

Re: [swift-evolution] [swift-users] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread Ted Kremenek via swift-evolution
> On Feb 9, 2017, at 9:30 AM, Matthew Johnson via swift-evolution > wrote: > > >> On Feb 9, 2017, at 11:16 AM, Jens Alfke via swift-users >> > wrote: >> >> >>> On Feb 9, 2017, at 3:41 AM, Jan Neumüller via

[swift-evolution] array splatting for variadic parameters

2017-02-09 Thread Dimitri Racordon via swift-evolution
Hello everyone. I understand that topic has already been discussed in the past, but I failed to get any information on its current state of affairs. I guess the subject of this mail is explicit, but to make sure I’m clear, here's a small snippet that illustrates the problem: func f(args:

Re: [swift-evolution] [swift-users] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread Ted Kremenek via swift-evolution
> On Feb 9, 2017, at 3:52 PM, Ted Kremenek via swift-users > wrote: > >> I’ve been mostly silent in this conversation largely because I didn’t >> realize it was leading up to a formal decision. I wish it would have >> followed the proposal process so it was clear to

Re: [swift-evolution] Strings in Swift 4

2017-02-09 Thread Shawn Erickson via swift-evolution
On Thu, Feb 9, 2017 at 5:09 PM Ted F.A. van Gaalen wrote: > On 10 Feb 2017, at 00:11, Dave Abrahams wrote: > > > on Thu Feb 09 2017, "Ted F.A. van Gaalen" > wrote: > > Hello Shawn > Just google with any programming language name and “string

Re: [swift-evolution] Warning when omitting default case for imported enums

2017-02-09 Thread Slava Pestov via swift-evolution
> On Feb 8, 2017, at 1:34 AM, Tino Heth via swift-evolution > wrote: > > >> Allowing the omission of a default case in an exhaustive switch makes the >> addition of a new case to the enum a breaking change. > Depending on the context, even with a default the

Re: [swift-evolution] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread Bouke Haarsma via swift-evolution
A big +1 for Discourse from me as well. I don't want to sign up to the mailing list and have mailbox overflow. I did have rules put in place to move the messages in a separate folder, but still the amount wasn't manageable. Furthermore reading the threads in Mail.app is a major pain as a

Re: [swift-evolution] Strings in Swift 4

2017-02-09 Thread Shawn Erickson via swift-evolution
On Thu, Feb 9, 2017 at 3:45 PM Hooman Mehr wrote: > On Feb 9, 2017, at 3:11 PM, Dave Abrahams wrote: > > > on Thu Feb 09 2017, "Ted F.A. van Gaalen" > wrote: > > Hello Shawn > Just google with any programming language name and “string manipulation” > and

Re: [swift-evolution] [swift-users] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread Adrian Zubarev via swift-evolution
That last one is horrible to even look at (that’s my personal point of view). It’s packed full with unnecessary UI, which reminds me of the time when html-tables ruled all over the place. Discourse has a nice minimalistic look and I’m sure people that will setup the forum will tweak it to make

Re: [swift-evolution] Strings in Swift 4

2017-02-09 Thread Shawn Erickson via swift-evolution
I also wonder what folks are actually doing that require indexing into strings. I would love to see some real world examples of what and why indexing into a string is needed. Who is the end consumer of that string, etc. Do folks have so examples? -Shawn On Thu, Feb 9, 2017 at 6:56 AM Ted F.A.

Re: [swift-evolution] [Pitch] consistent public access modifiers

2017-02-09 Thread Matthew Johnson via swift-evolution
> On Feb 8, 2017, at 5:48 PM, Xiaodi Wu wrote: > > I agree very much with rationalizing access levels, but I'm not sure I like > this proposal for public vs. closed. How would the compiler stop me from > editing my own code if something is closed? The answer must be that

Re: [swift-evolution] Strings in Swift 4

2017-02-09 Thread Ben Cohen via swift-evolution
> On Feb 9, 2017, at 7:48 AM, Shawn Erickson via swift-evolution > wrote: > > I also wonder what folks are actually doing that require indexing into > strings. I would love to see some real world examples of what and why > indexing into a string is needed. Who is

Re: [swift-evolution] [Pitch] consistent public access modifiers

2017-02-09 Thread Matthew Johnson via swift-evolution
> On Feb 8, 2017, at 7:02 PM, Adrian Zubarev via swift-evolution > wrote: > > Hurray, I cannot wait to get the consistent behavior of open/public > protocols. I’m not sure I could follow the idea behind the proposed closed > keyboard/access modifier. It almost felt

Re: [swift-evolution] for-else syntax

2017-02-09 Thread Alejandro Martinez via swift-evolution
-1 for me. I don't see a good enough reasons to change the language and add another control-flow variant. I would much rather see a language improvement that somehow allowed to implement it as a lib supporting break/continue. Something like what Haravikk suggested. On Tue, Feb 7, 2017 at 12:26

Re: [swift-evolution] Annotation of Warnings/Errors

2017-02-09 Thread Alejandro Martinez via swift-evolution
I don't think this is a language issue, as said warnings and fix-its are really useful. In the other handm when watching other programmers in other languages without IDE triggering a compile trough the terminal I see that it allows them to put all their ideas into code first, and then deal with

Re: [swift-evolution] Class and Subclass Existentials (Round 2)

2017-02-09 Thread Step Christopher via swift-evolution
Looks good. Minor comments below: > let t: P & C // Compiler error: subclass contraint must be in first position Typo: contraint should be constraint > ... > typealias TA4 = D & P2 > typealias TA5 = E & P2 > > typealias TA5 = TA1 & TA2 > typealias TA5 = class & P1 & class & P2 // Expansion >

Re: [swift-evolution] [swift-users] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread Adrian Zubarev via swift-evolution
I’m sorry for you, but I don’t think we’re talking in this thread about being old and wearing glasses or not. My eyes aren’t the best either, but I’m not complaining about that or try to make this as an argument against minimalistic designs. (Coloring is a different story of its own.) How’s

Re: [swift-evolution] [swift-users] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread Karl Wagner via swift-evolution
Happy dance!  I've said before that I think this a good move. Hopefully it encourages more ad-hoc contributions - e.g. Unicode experts who have suggestions for the String model, Perl developers with suggestions for pattern-matching, systems architects with suggestions

Re: [swift-evolution] [swift-users] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread Martin Man via swift-evolution
Is there any reason why there needs to be a separate tool for this? If mailing lists are no go why not just stay on GitHub and use GitHub issues for proposals? Thanks, Martin > On 9 Feb 2017, at 08:51, Jens Alfke via swift-users > wrote: > > >> On Feb 8, 2017, at

Re: [swift-evolution] Protocol requirement `where` clauses constraining associated types

2017-02-09 Thread Douglas Gregor via swift-evolution
> On Feb 8, 2017, at 11:12 PM, Slava Pestov wrote: > >> >> On Feb 8, 2017, at 10:30 PM, Douglas Gregor wrote: >> >> >>> On Feb 8, 2017, at 10:21 PM, Slava Pestov wrote: >>> >>> Hah, Doug and I were just discussing this. >>> >>> In

Re: [swift-evolution] [swift-users] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread Adrian Zubarev via swift-evolution
The quote below made my day dear Swift friend as I might remind you that if modern is associated with hate in your mind, then the modern programming language called Swift would probably be a bad choice. I might remind everyone that Discourse is open sourced and therefore tweaks are possible.

Re: [swift-evolution] Strings in Swift 4

2017-02-09 Thread Ted F.A. van Gaalen via swift-evolution
Hello Hooman That invalidates my assumptions, thanks for evaluating it's more complex than I thought. Kind Regards Ted > On 8 Feb 2017, at 00:07, Hooman Mehr wrote: > > >> On Feb 7, 2017, at 12:19 PM, Ted F.A. van Gaalen via swift-evolution >>

Re: [swift-evolution] [swift-users] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread Jan Neumüller via swift-evolution
> On 9 Feb 2017, at 14:32, Adrian Zubarev > wrote: > > I’m sorry for you, but I don’t think we’re talking in this thread about being > old and wearing glasses or not. My eyes aren’t the best either, but I’m not > complaining about that or try to make this as

Re: [swift-evolution] [swift-users] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread Jan Neumüller via swift-evolution
> On 9 Feb 2017, at 13:50, Adrian Zubarev > wrote: > > That last one is horrible to even look at (that’s my personal point of view). > It’s packed full with unnecessary UI, which reminds me of the time when > html-tables ruled all over the place. Discourse

Re: [swift-evolution] [swift-users] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread Jan Neumüller via swift-evolution
Well, if the community likes it so much. Have fun with it. I will leave as I have left the Developer Forums at Apple because they became unusable. > On 9 Feb 2017, at 15:17, Adrian Zubarev > wrote: > > The quote below made my day dear Swift friend as I might

Re: [swift-evolution] [swift-users] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread Jan Neumüller via swift-evolution
My problem with Discourse lies in its terrible ui. It is like most modern social media: totally useless to find stuff and stay organized in it. It reminds my heavy on the terrible ui of Facebook and the redone developer forums at Apple that have gone from fine to utterly useless chaos. Perhaps

Re: [swift-evolution] [Pitch] consistent public access modifiers

2017-02-09 Thread Matthew Johnson via swift-evolution
> On Feb 9, 2017, at 10:33 AM, Adrian Zubarev > wrote: > > The last explanation is great, now I could follow the idea behind the > proposed closed keyword/access modifier. I do now understand the contract on > enums, but I’m struggling to understand how

Re: [swift-evolution] [swift-users] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread Cihat Gündüz via swift-evolution
@Jan: Your arguments are very subjective if not even insulting and derogatory to many people who invest a lot of time and effort in crafting those things you despise so openly. Here are just a few example quotes for you to reflect your language: "I despise fp“, „is so annoying“, "made Swift

Re: [swift-evolution] SE-0152: Package Manager Tools Version

2017-02-09 Thread Will Field-Thompson via swift-evolution
> > Is there a particular reason you're envisioning that we might need to extend > the metadata for the Swift tools version? I can't think of any reason myself, I just noticed the escape hatch and was wondering if there were any planned uses for it! > We've left ourself an escape hatch in

Re: [swift-evolution] [swift-users] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread Matthew Johnson via swift-evolution
> On Feb 9, 2017, at 11:16 AM, Jens Alfke via swift-users > wrote: > > >> On Feb 9, 2017, at 3:41 AM, Jan Neumüller via swift-users >> > wrote: >> >> I would prefer http://www.fudforum.org/

Re: [swift-evolution] Is it possible to compile swift code to dynamic library ?

2017-02-09 Thread Derrick Ho via swift-evolution
If you use the "swiftc" command it will create an executable. Maybe there is a command in there to create linker files which you can offer to your c project. Any one on this threat super knowledgeable on the "swiftc" command? On Thu, Feb 9, 2017 at 1:53 AM Zheng Ping via swift-evolution <

Re: [swift-evolution] [swift-users] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread Michael Sheaver via swift-evolution
I have a simple question along this line: How does expanding the capabilities of Swift detract or impair its use in a fully OO manner? From what I have seen, if you want to use it in a strictly OO manner, great! If you want to use it in a strictly functional manner, no problem. If you want to

Re: [swift-evolution] protocol-oriented integers (take 2)

2017-02-09 Thread Max Moiseev via swift-evolution
Hi Ben, The reason to include init?(exactly:T) as a requirement for the Arithmetic (now Number) protocol was that it already refines ExpressibleByIntegerLiteral, so it would be quite weird to *not* allow explicit initialization. Generic conversion to floating point types is not covered by

Re: [swift-evolution] I think we need more to our type calculus

2017-02-09 Thread Joe Groff via swift-evolution
> On Feb 8, 2017, at 12:09 PM, Daryle Walker via swift-evolution > wrote: > > I’ve been trying to get the maximum of a list of counts. I started by using > “myCollection.map { $0.myCountProperty }.reduce(0, max)”. Then I thought I > should really use the value

Re: [swift-evolution] Class and Subclass Existentials (Round 2)

2017-02-09 Thread Joe Groff via swift-evolution
> On Feb 9, 2017, at 4:26 AM, Step Christopher via swift-evolution > wrote: > > Looks good. Minor comments below: > >> let t: P & C // Compiler error: subclass contraint must be in first position > > Typo: contraint should be constraint >> >>

Re: [swift-evolution] [swift-users] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread David Sweeris via swift-evolution
> On Feb 9, 2017, at 09:30, Matthew Johnson via swift-users > wrote: > > >>> On Feb 9, 2017, at 11:16 AM, Jens Alfke via swift-users >>> wrote: >>> >>> >>> On Feb 9, 2017, at 3:41 AM, Jan Neumüller via swift-users >>>

Re: [swift-evolution] [swift-users] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread Rien via swift-evolution
> On 09 Feb 2017, at 18:29, Cihat Gündüz via swift-evolution > wrote: > > @Jan: Your arguments are very subjective if not even insulting and derogatory > to many people who invest a lot of time and effort in crafting those things > you despise so openly. Here are

Re: [swift-evolution] [swift-users] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread André Videla via swift-evolution
Lots of emotions here. There is something I would like to point out that I don't feel is clear enough. The goal of this move is to move the community forward. The way it is moving the community forward is by increasing the scope of people able to participate while allowing new capabilities

Re: [swift-evolution] Nil-rejection operator

2017-02-09 Thread Hooman Mehr via swift-evolution
I think the best solution is overloading the existing ?? operator. It is very easy to do: func ??(lhs: T?, rhs: U) throws -> T { if let lhs = lhs { return lhs } else { throw rhs } } then you can say: do { let y = try x ?? myError } catch ... It might even

Re: [swift-evolution] [swift-users] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread Milos Jakovljevic via swift-evolution
+1 for Discourse Sent from my iPhone > On Feb 9, 2017, at 14:32, Adrian Zubarev via swift-evolution > wrote: > > I’m sorry for you, but I don’t think we’re talking in this thread about being > old and wearing glasses or not. My eyes aren’t the best either, but I’m