Re: [swift-evolution] ternary operator ?: suggestion

2016-01-06 Thread John Randolph via swift-evolution
Really not a fan of the idea of bloating the ternary operator out to deal with more cases. That’s what we already have switch and enum for. -jcr ___ swift-evolution mailing list swift-evolution@swift.org

Re: [swift-evolution] ternary operator ?: suggestion

2016-01-06 Thread Charles Constant via swift-evolution
I can't stop fiddling around with this... so here's another minor variation. My new new favourite, if we're doubling down on the ternary. We could start with Paul's ternary example... but it seems more in keeping to me, with the existing ternary, to use a colon as a separator. If we do that, an

Re: [swift-evolution] ternary operator ?: suggestion

2016-01-06 Thread Paul Ossenbruggen via swift-evolution
To point 1: I agree it needs a new name, I came up with the “demux expression” but maybe there is a better name. To point 2: Taking a more complex example which uses _ adapted from the swift book. The original switch somePoint { case (0, 0): print("(0, 0) is at the origin") case (_, 0):

Re: [swift-evolution] ternary operator ?: suggestion

2016-01-06 Thread Jo Albright via swift-evolution
Just a couple of thoughts swirling in my brain. 1. Ternary means : composed of three parts …. if we add case functionality, it no longer is a ternary and should be renamed (ex : nil coalescing … was used instead of calling it a ternary optional). Would love to hear thoughts on what names it

Re: [swift-evolution] ternary operator ?: suggestion

2016-01-06 Thread Paul Ossenbruggen via swift-evolution
Made a mistake on first example underscore should not have been quoted: let resultString = someCharacter ?( "a", "e", "i", "o", “u”: "\(someCharacter) is a vowel" "b", "c", "d", "f", "g", "h", "j", "k", "l", “m”, "n", "p", "q", "r", "s", "t", "v", "w", "x", "y", "z”:

Re: [swift-evolution] ternary operator ?: suggestion

2016-01-06 Thread Paul Ossenbruggen via swift-evolution
r...@charlesism.com>> > Sent: Wednesday, January 6, 2016 21:26 > Subject: Re: [swift-evolution] ternary operator ?: suggestion > To: Alex Popov <he...@alexpopov.ca <mailto:he...@alexpopov.ca>> > Cc: Swift Evolution <swift-evolution@swift.org > <mailto:swift-

Re: [swift-evolution] ternary operator ?: suggestion

2016-01-06 Thread Charles Constant via swift-evolution
Alex, We know, from the traditional ternary, that a colon is going to satisfy the requirements of a separator, even when we want to chain. Is this the case with bar "|"? To me, this doesn't bode well let a = b ? 2 : 3 | 4 : 5 | _ : -1 Above, are we talking about a result of "3

Re: [swift-evolution] ternary operator ?: suggestion

2016-01-06 Thread Craig Cruden via swift-evolution
multiary is not a natural and easy expression to pronounce. ternary was likely used originally because they could not think of something better - but at least it is easy on the tongue…. [composed of 3 parts] regardless of syntax - maybe just call it a “match expression”. > On 2016-01-07,

Re: [swift-evolution] ternary operator ?: suggestion

2016-01-06 Thread Charles Constant via swift-evolution
Hi Paul, My opinion, atm, is that ":" as a separator is the best solution. True, it's not *Swift-like*, but neither is the existing ternary, which Chris wants to keep. On then other hand, "colon as separator" is extremely *ternary-like*. So benefits of "colon as separator" as I see them: -

Re: [swift-evolution] ternary operator ?: suggestion

2016-01-06 Thread Charles Constant via swift-evolution
> I see what you are trying to do, because of the colon being both used for switch cases and > separators for the ternary and so there needs to be a new character for each case. > I am not sure that putting colons between each case is really necessary though. Most of us (including you and I) like

Re: [swift-evolution] ternary operator ?: suggestion

2016-01-06 Thread Alex Popov via swift-evolution
I like the bar `|` variation, but I do think the control value should be out front, otherwise the ? reads as an optional to my mind, whereas the former comes across as the beginning of a ternary (which this is effectively an extension of). The bar variation feels Haskell-y in a satisfying way,

Re: [swift-evolution] ternary operator ?: suggestion

2016-01-06 Thread Alex Popov via swift-evolution
_ From: Charles Constant <char...@charlesism.com> Sent: Wednesday, January 6, 2016 21:26 Subject: Re: [swift-evolution] ternary operator ?: suggestion To: Alex Popov <he...@alexpopov.ca> Cc: Swift Evolution <swift-evolution@swift.org>, Paul Ossenbruggen

Re: [swift-evolution] ternary operator ?: suggestion

2016-01-06 Thread Charles Constant via swift-evolution
> multiary is not a natural and easy expression to pronounce. I'd be fine with "match expression". Also fine with "multary" (no "i"), which is apparently a common alternative to "multiary." If we use the "colon as separator" version of this proposal, which uses the existing syntax for a ternary,

Re: [swift-evolution] ternary operator ?: suggestion

2016-01-05 Thread Sean Heber via swift-evolution
> On Jan 5, 2016, at 12:29 AM, Thorsten Seitz via swift-evolution > wrote: > > I once suggested the following ternary like switch: > > let x = color ? > case .Red: 0xFF > case .Green: 0x00FF00 > case .Blue: 0xFF > default:

Re: [swift-evolution] ternary operator ?: suggestion

2016-01-05 Thread Matthew Johnson via swift-evolution
> On Jan 5, 2016, at 10:51 AM, Sean Heber wrote: > >>> And maybe allow a special case for boolean where you can leave off the >>> “case true:” part: >>> >>> let x = something ? thing() else: otherThing() >>> >>> And then you could more or less replace ternary with this new

Re: [swift-evolution] ternary operator ?: suggestion

2016-01-05 Thread Sean Heber via swift-evolution
>> And maybe allow a special case for boolean where you can leave off the “case >> true:” part: >> >> let x = something ? thing() else: otherThing() >> >> And then you could more or less replace ternary with this new construct that >> can do even more while looking very similar and still being

Re: [swift-evolution] ternary operator ?: suggestion

2016-01-05 Thread Matthew Johnson via swift-evolution
> On Jan 5, 2016, at 10:23 AM, Sean Heber wrote: > > >> On Jan 5, 2016, at 12:29 AM, Thorsten Seitz via swift-evolution >> wrote: >> >> I once suggested the following ternary like switch: >> >> let x = color ? >>case .Red: 0xFF >>

Re: [swift-evolution] ternary operator ?: suggestion

2016-01-05 Thread Matthew Johnson via swift-evolution
> On Jan 5, 2016, at 11:05 AM, Thorsten Seitz wrote: > >> >> Am 05.01.2016 um 17:29 schrieb Matthew Johnson : >> >> >>> On Jan 5, 2016, at 10:23 AM, Sean Heber wrote: >>> >>> On Jan 5, 2016, at 12:29 AM, Thorsten Seitz

Re: [swift-evolution] ternary operator ?: suggestion

2016-01-05 Thread Thorsten Seitz via swift-evolution
> Am 05.01.2016 um 16:23 schrieb Matthew Johnson > >> On Jan 5, 2016, at 9:12 AM, Craig Cruden wrote: >> >> Is there a reason why we are reusing “?” since the proposal is to leave >> ternary ? : as is. And “?” is also used by optionals. Why

Re: [swift-evolution] ternary operator ?: suggestion

2016-01-05 Thread Thorsten Seitz via swift-evolution
While it is real nice what can be done with a library solution, the switch-expression allows more than just comparing with a value. Library solutions won't be able to achieve the following features: - pattern matching - where clauses - exhaustiveness check -Thorsten > Am 05.01.2016 um 18:10

Re: [swift-evolution] ternary operator ?: suggestion

2016-01-05 Thread Matthew Johnson via swift-evolution
> On Jan 5, 2016, at 12:29 AM, Thorsten Seitz wrote: > > I once suggested the following ternary like switch: > > let x = color ? > case .Red: 0xFF > case .Green: 0x00FF00 > case .Blue: 0xFF > default: 0xFF This is the

Re: [swift-evolution] ternary operator ?: suggestion

2016-01-05 Thread Craig Cruden via swift-evolution
Is there a reason why we are reusing “?” since the proposal is to leave ternary ? : as is. And “?” is also used by optionals. Why not just use a new keyword like “match” (which I prefer better than which - but that may be because it is familiar to me :p ). then reuse the rest of switch

Re: [swift-evolution] ternary operator ?: suggestion

2016-01-05 Thread Matthew Johnson via swift-evolution
Sent from my iPad > On Jan 5, 2016, at 9:12 AM, Craig Cruden wrote: > > Is there a reason why we are reusing “?” since the proposal is to leave > ternary ? : as is. And “?” is also used by optionals. Why not just use a > new keyword like “match” (which I prefer

Re: [swift-evolution] ternary operator ?: suggestion

2016-01-05 Thread Thorsten Seitz via swift-evolution
I once suggested the following ternary like switch: let x = color ? case .Red: 0xFF case .Green: 0x00FF00 case .Blue: 0xFF default: 0xFF Reusing "case" and "default" makes it possible IMO to distinguish the cases even if writing them in one line

Re: [swift-evolution] ternary operator ?: suggestion

2016-01-05 Thread Thorsten Seitz via swift-evolution
In addition to the problems that you already cited, a library could not check exhaustiveness and we would lose pattern matching. -Thorsten > Am 05.01.2016 um 00:53 schrieb Paul Ossenbruggen via swift-evolution > : > > Just tried going down this path a bit of

Re: [swift-evolution] ternary operator ?: suggestion

2016-01-05 Thread Matthew Johnson via swift-evolution
> On Jan 5, 2016, at 12:37 PM, Marcelo Alves via swift-evolution > wrote: > > >> On Jan 5, 2016, at 16:06, Thorsten Seitz via swift-evolution >> > wrote: >> >> >>> Am 05.01.2016 um 18:12 schrieb Matthew

Re: [swift-evolution] ternary operator ?: suggestion

2016-01-05 Thread Thorsten Seitz via swift-evolution
> Am 05.01.2016 um 18:12 schrieb Matthew Johnson : > > On Jan 5, 2016, at 12:29 AM, Thorsten Seitz via swift-evolution > > wrote: > > I once suggested the following ternary like switch: >

Re: [swift-evolution] ternary operator ?: suggestion

2016-01-05 Thread Matthew Johnson via swift-evolution
> On Jan 5, 2016, at 12:06 PM, Thorsten Seitz wrote: > > >> Am 05.01.2016 um 18:12 schrieb Matthew Johnson > >: >> >> On Jan 5, 2016, at 12:29 AM, Thorsten Seitz via swift-evolution >>

Re: [swift-evolution] ternary operator ?: suggestion

2016-01-05 Thread Marcelo Alves via swift-evolution
> On Jan 5, 2016, at 16:06, Thorsten Seitz via swift-evolution > wrote: > > >> Am 05.01.2016 um 18:12 schrieb Matthew Johnson > >: >> >> On Jan 5, 2016, at 12:29 AM, Thorsten Seitz via swift-evolution

Re: [swift-evolution] ternary operator ?: suggestion

2016-01-05 Thread Paul Ossenbruggen via swift-evolution
Heh, one other thought. Pretty sure this was rejected by the switch statement but if keeping it concise for expressions is a goal then _ might make sense for the default case especially with this form. :-) let fh = ?(color, .Red: 0xFF // only one expression can be the result here so case

Re: [swift-evolution] ternary operator ?: suggestion

2016-01-04 Thread Howard Lovatt via swift-evolution
-1 for me. None of it looks or feels like Swift, more like Haskell. I would prefer a library solution for now and remove ?: from the language and add a which into the standard library and see how that goes and if there is need for more. Sorry, Howard. > On 5 Jan 2016, at 7:24 AM, Paul

Re: [swift-evolution] ternary operator ?: suggestion

2016-01-04 Thread Paul Ossenbruggen via swift-evolution
Any feedback on this? I am rethinking the idea of #( because of the # prior usage as a preprocessor directive, but like how it stands out and has a meaning. If no feedback, does it make sense to update my proposal with these ideas? Or does this feel like the wrong direction. > On Dec 30,

Re: [swift-evolution] ternary operator ?: suggestion

2016-01-04 Thread Rod Brown via swift-evolution
For all the proposals I've seen on this topic, I have to say -1. While I agree with the notions surrounding this operator, I've yet to see a better alternative presented, and none that feel truly Swift. If someone has a great proposal, though, I look forward to seeing it. - Rod > On 5 Jan

Re: [swift-evolution] ternary operator ?: suggestion

2016-01-04 Thread Charles Constant via swift-evolution
Our ternary-like switch is now in the "commonly_proposed.md" file, which doesn't bode very well. It puzzles me that there isn't more enthusiasm. Are we the only ones who get irritated taking up so much space with a "switch" when all we need to do is transform between two sets of values? I think

Re: [swift-evolution] ternary operator ?: suggestion

2016-01-04 Thread Paul Ossenbruggen via swift-evolution
Just tried going down this path a bit of creating a library. You can get pretty far for the boolean or integer types, but don’t see a way to do a switch like solution. Also, a big problem with this approach is there is no way to short circuit evaluate the expressions in the list of a variadic

Re: [swift-evolution] ternary operator ?: suggestion

2016-01-04 Thread Paul Ossenbruggen via swift-evolution
So without additional language support, I don’t see a library is workable but maybe it can. Maybe we can add variadic function lists? And new capabilities that are building blocks for building a switch expression. > On Jan 4, 2016, at 3:53 PM, Paul Ossenbruggen wrote: > >

Re: [swift-evolution] ternary operator ?: suggestion

2016-01-04 Thread Matthew Johnson via swift-evolution
Sent from my iPad > On Jan 4, 2016, at 5:45 PM, Charles Constant wrote: > > Our ternary-like switch is now in the "commonly_proposed.md" file, which > doesn't bode very well. It puzzles me that there isn't more enthusiasm. Are > we the only ones who get irritated

Re: [swift-evolution] ternary operator ?: suggestion

2016-01-04 Thread Matthew Johnson via swift-evolution
> On Jan 4, 2016, at 2:37 PM, Paul Ossenbruggen via swift-evolution > wrote: > > Good feedback, I am all for making it feel more like swift. Any ideas would > be welcome. I will also try to come up with some myself. My suggestion is to leave ternary alone and try

Re: [swift-evolution] ternary operator ?: suggestion

2016-01-04 Thread Paul Ossenbruggen via swift-evolution
I can work on making the proposal shorter if that will help. Any suggestions, for what could be made better. I am trying to be detailed but maybe that is making it too long. I am also not sure why this is not getting people excited. This seems like a clear win to me just being able to use

Re: [swift-evolution] ternary operator ?: suggestion

2016-01-04 Thread Paul Ossenbruggen via swift-evolution
This is what is on the Commonly Rejected Changes section: Replace ?: Ternary Operator : Definitely magical, but it serves a very important use-case for terse selection of different values. Proposals for

Re: [swift-evolution] ternary operator ?: suggestion

2016-01-04 Thread Charles Constant via swift-evolution
My best guesses here, since I didn't write and don't entirely agree... *> Please detail what the trade offs are* Other than more complexity, I think this refers to making the "switch" statement do two slightly different things. Of course, if we call it something else, like "match" or "which"

Re: [swift-evolution] ternary operator ?: suggestion

2015-12-29 Thread James Campbell via swift-evolution
What if you could wrap the existing switch statement in a closure and return a value from that closure like so Let value = { switch (other) { Case .Some(let value): Return value // because this is in a closure the closure will return the value not the function this is in Case .None: Return

Re: [swift-evolution] ternary operator ?: suggestion

2015-12-29 Thread Matthew Johnson via swift-evolution
Sent from my iPad > On Dec 29, 2015, at 7:28 AM, Craig Cruden via swift-evolution > wrote: > > That looks pretty ugly. > > I think the best we can hope for at this point is maybe another keyword that > mirrors switch but is expression based (aka match) —

Re: [swift-evolution] ternary operator ?: suggestion

2015-12-29 Thread Matthew Johnson via swift-evolution
> On Dec 29, 2015, at 8:54 AM, Charles Constant wrote: > > I'm with Matthew/Craig. > > We discussed a couple very ternary-like versions earlier in the thread, which > I increasingly think are the best options. > > The major objection to this came from Lattner, and his

Re: [swift-evolution] ternary operator ?: suggestion

2015-12-29 Thread Charles Constant via swift-evolution
I'm with Matthew/Craig. We discussed a couple very ternary-like versions earlier in the thread, which I increasingly think are the best options. The major objection to this came from Lattner, and his objection, if I have it right, is "this proposal doesn't add enough functionality to justify the

Re: [swift-evolution] ternary operator ?: suggestion

2015-12-29 Thread Craig Cruden via swift-evolution
That looks pretty ugly. I think the best we can hope for at this point is maybe another keyword that mirrors switch but is expression based (aka match) — leaving the ternary ? : expression as is - which is not all that bad since any if else that becomes a compound expression or more than two

Re: [swift-evolution] ternary operator ?: suggestion

2015-12-28 Thread Thorsten Seitz via swift-evolution
No exhaustiveness checking is a serious deficiency :-( -Thorsten > Am 17.12.2015 um 08:09 schrieb Brent Royal-Gordon via swift-evolution > : > > Actually, this *almost* does what you want. No @autoclosure for the values > and no exhaustiveness checking, but

Re: [swift-evolution] ternary operator ?: suggestion

2015-12-28 Thread Howard Lovatt via swift-evolution
You can replace the proposed statement `which` (another thread), the existing statement `?:` (this thread), and the global function `??` (which is an odd ball) with matching library methods. A library method is likely slower than a built in at this stage until the optimiser improves, but a

Re: [swift-evolution] ternary operator ?: suggestion

2015-12-24 Thread Paul Ossenbruggen via swift-evolution
Hi David, I have been using ?( as kind of a more general meaning that there is a question here not that ? is just for optionals. I am fine with using some other character or word if it expresses the idea that the expression returns one of the results based upon the control parameter. ? is kind

Re: [swift-evolution] ternary operator ?: suggestion

2015-12-23 Thread Charles Constant via swift-evolution
> In the case where your input is hashable, you could just do: > > let i = [.Red:0xff, .Green:0x00ff00, .Blue:0xff][color] You forgot to declare the type, which is mandatory if you want to use abbreviated cases like ".Red" to construct a one-off like that. That's one of the reasons I

Re: [swift-evolution] ternary operator ?: suggestion

2015-12-23 Thread Félix Cloutier via swift-evolution
I know, but that won't support pattern matching. Félix > Le 23 déc. 2015 à 02:22:07, David Waite a > écrit : > > In the case where your input is hashable, you could just do: > > let i = [.Red:0xff, .Green:0x00ff00, .Blue:0xff][color] > > this would mean

Re: [swift-evolution] ternary operator ?: suggestion

2015-12-23 Thread Rainer Brockerhoff via swift-evolution
On 22/12/15 16:50 , swift-evolution-requ...@swift.org wrote: > Date: Tue, 22 Dec 2015 10:07:26 -0800 > From: Jordan Rose > To: Thorsten Seitz > Message-ID: <2d35f5bd-3ddf-43c3-a461-14fb65530...@apple.com> > > I think this is a good point. We

Re: [swift-evolution] ternary operator ?: suggestion

2015-12-23 Thread Paul Ossenbruggen via swift-evolution
Been thinking about the boolean case a bit more, and how to make it better than a ternary using my proposed syntax. So else could be put there to help show it is the opposite. The downside is this makes it mix keywords and operators so seems a bit jarring. With the new form parenthesis are

Re: [swift-evolution] ternary operator ?: suggestion

2015-12-23 Thread Charles Constant via swift-evolution
> In the case where your input is hashable, you could just do: > > let i = [.Red:0xff, .Green:0x00ff00, .Blue:0xff][color] Mea culpa: you were correct, this actually *does* work in a Playground, as long as you access it when you construct it. I didn't realize Swift was smart enough to

Re: [swift-evolution] ternary operator ?: suggestion

2015-12-22 Thread Paul Ossenbruggen via swift-evolution
I think trying to mix statements and expressions will definitely lead to a more complex solution I have tried going down that path. The second and third approaches in my email last night attempt to straddle the line between more cryptic ? syntax of the ternary and the if, switch, approach. I

Re: [swift-evolution] ternary operator ?: suggestion

2015-12-22 Thread Félix Cloutier via swift-evolution
This is essentially the latest proposal that Paul offered. Félix > Le 22 déc. 2015 à 13:11:37, Thorsten Seitz a écrit : > > I still don't understand why we are not simply writing > > let i = switch color { > case .Red: 0xFF > case .Green: 0x00FF00 >

Re: [swift-evolution] ternary operator ?: suggestion

2015-12-22 Thread Paul Ossenbruggen via swift-evolution
I have definitely been trying to keep this in mind with these designs. Compact representations should be possible. > On Dec 22, 2015, at 10:07 AM, Jordan Rose wrote: > > I think this is a good point. We definitely want to keep the boolean ternary > operator compact for

Re: [swift-evolution] ternary operator ?: suggestion

2015-12-22 Thread Paul Ossenbruggen via swift-evolution
This is interesting, the “which" out front helps to keep conditional from just “floating" as it does with the ternary and using the square brackets and a dictionary like sequence is pretty cool. I did think a bit along these lines too. You could have a Array like and Dictionary like form. The

Re: [swift-evolution] ternary operator ?: suggestion

2015-12-22 Thread Craig Cruden via swift-evolution
IMHO, I think the issue is that (at least in my case) we may be trying to create expression versions of “if” and “switch” (multi-line) and not are trying to create them in such a way as to keep statements and expressions as separate syntax / keywords…. which is leading to a more cryptic

Re: [swift-evolution] ternary operator ?: suggestion

2015-12-22 Thread Paul Ossenbruggen via swift-evolution
All, I have continued work on my proposal. I am trying to gauge whether people feel that this syntax which is currently in the proposal is better or worse than the last two variations. The current proposal syntax: let a = ?(x == y: a, b) let b = ?(colorEnum : Red: 0xFF, .Green: 0x00FF00,

Re: [swift-evolution] ternary operator ?: suggestion

2015-12-22 Thread Félix Cloutier via swift-evolution
In my opinion, the operator has a future. Swift is merely moving away from C-style constructs that promote mutable state. This kind of inline switch expression actually reminds me of pattern matching constructs in functional languages, and it may pick up more steam if the proposal for

Re: [swift-evolution] ternary operator ?: suggestion

2015-12-22 Thread Craig Cruden via swift-evolution
I see no need to remove the existing ternary command — for simple conditions of assignment (one condition, one then value, one else value) that fit on one line…. nested conditions regardless of syntax can quickly become nightmare. What I would like to be able to do is write code in a

Re: [swift-evolution] ternary operator ?: suggestion

2015-12-22 Thread David Waite via swift-evolution
In the case where your input is hashable, you could just do: let i = [.Red:0xff, .Green:0x00ff00, .Blue:0xff][color] this would mean that color must be a Color and not an Optional (because of swift 2.x limitations) -DW > On Dec 22, 2015, at 8:04 AM, Félix Cloutier via swift-evolution

Re: [swift-evolution] ternary operator ?: suggestion

2015-12-20 Thread Howard Lovatt via swift-evolution
How about removing ?: and adding a simple library: struct IfFalse { let condition: Bool let ifTrue: () -> T init(condition: Bool, ifTrue: () -> T) { self.condition = condition self.ifTrue = ifTrue } func ifFalse(ifFalse: () ->

Re: [swift-evolution] ternary operator ?: suggestion

2015-12-20 Thread Craig Cruden via swift-evolution
The complaint that you have about Javascript is more a function of it not being a strongly typed language. If you were to write a function with the type of return specified and the code inside the function (because of a single character) end up changing type for the return value or a future

Re: [swift-evolution] ternary operator ?: suggestion

2015-12-20 Thread Stephen Canon via swift-evolution
Paul, does the proposed operator short-circuit like ternary does (i.e. is only the active case evaluated)? – Steve > On Dec 19, 2015, at 11:42 AM, Paul Ossenbruggen via swift-evolution > wrote: > > Thanks, great feedback! > > Good point about the floats, that is

Re: [swift-evolution] ternary operator ?: suggestion

2015-12-19 Thread Paul Ossenbruggen via swift-evolution
Thanks, great feedback! Good point about the floats, that is definitely a hole in my proposal! I will update it with that. To the list form being confusing, I would definitely like to know if others agree that having the two forms is confusing. The list form would be zero based. I would

Re: [swift-evolution] ternary operator ?: suggestion

2015-12-19 Thread Dennis Lysenko via swift-evolution
+1 to Jordan's points as well. Generally speaking, there is clearly a wide variety of things that cause people to be interested in this particular proposal and I don't think we can reconcile all of them. For example, I think that "collapsing an if statement into one line" isn't a good enough

Re: [swift-evolution] ternary operator ?: suggestion

2015-12-19 Thread Paul Ossenbruggen via swift-evolution
> On Dec 19, 2015, at 8:37 PM, Dennis Lysenko via swift-evolution > wrote: > > +1 to Jordan's points as well. > > Generally speaking, there is clearly a wide variety of things that cause > people to be interested in this particular proposal and I don't think we

Re: [swift-evolution] ternary operator ?: suggestion

2015-12-19 Thread Paul Ossenbruggen via swift-evolution
Thank you for your feedback! Just want to respond a little bit, I don’t believe it is any worse than the ternary in terms of it being non obvious as to what it does, and it adds a lot of power beyond the ternary, because now you can switch to more than two outcomes. In terms of readability,

Re: [swift-evolution] ternary operator ?: suggestion

2015-12-19 Thread Jordan Rose via swift-evolution
It's a nice, consistent proposal, but I don't feel like this solves any of the complaints about the existing ternary operator: - It's not obvious what it does when you first learn it. - The '?' doesn't have anything to do with Optionals. It is a way to put 'switch' into an expression. I'm not a

Re: [swift-evolution] ternary operator ?: suggestion

2015-12-19 Thread Dave Abrahams via swift-evolution
> On Dec 19, 2015, at 7:55 PM, Jordan Rose via swift-evolution > wrote: > > It's a nice, consistent proposal, but I don't feel like this solves any of > the complaints about the existing ternary operator: > > - It's not obvious what it does when you first learn it.