Re: [go-nuts] Ternary ... again

2018-08-16 Thread Peter Waller
On Wed, 15 Aug 2018 at 12:44, peterGo wrote: > Remember the Vasa! http://www.stroustrup.com/P0977-remember-the-vasa.pdf > That note from Stroustroup is profound. Thanks for sharing. Personally, I'm glad that we have a language where the philosophy is "What is the minimum feature-set which allows

Re: [go-nuts] Ternary ... again

2018-08-16 Thread Jesper Louis Andersen
On Tue, Aug 14, 2018 at 6:43 PM Mark Volkmann wrote: > I’m new to Go and I imagine the idea of adding a ternary operator to Go > has been discussed many times. Rather than repeat that, can someone point > me to a discussion about why Go doesn’t add this? I’m struggling to > understand why it is d

Re: [go-nuts] Ternary ... again

2018-08-16 Thread Wojciech S. Czarnecki
On Tue, 14 Aug 2018 05:43:07 -0500 Mark Volkmann wrote: > I’m new to Go and I imagine the idea of adding a ternary operator to Go has > been discussed many times. Rather than repeat that, can someone point me to > a discussion about why Go doesn’t add this? > I’m struggling to understand why it

Re: [go-nuts] Ternary ... again

2018-08-16 Thread 'Kean Ho Chew' via golang-nuts
> > The first is ternaries. What if only simple, non-nested ternaries were > supported? For example, color := temperature > 100 ? “red” : “blue”. This > seems so much more clear than the map[bool]:string trick that some have > proposed. Writing this with an if statement takes either 4 or 6 line

Re: [go-nuts] Ternary ... again

2018-08-15 Thread Nathan Youngman
Mark, Funny that -- you suggest that adding another syntax for the same behaviour "might help with adoption". I think the opposite is true. My friend has been learning iOS development and has found many things confusing. There is the lambda syntax in Swift, and then the trailing lambda synta

Re: [go-nuts] Ternary ... again

2018-08-15 Thread Volker Dobler
On Wednesday, 15 August 2018 13:23:36 UTC+2, Mark Volkmann wrote: > > [...] > The first is ternaries. What if only simple, non-nested ternaries were > supported? For example, color := temperature > 100 ? “red” : “blue”. > It is easy to write "non-nested" but it is hard to define. Probably a?(b?c

Re: [go-nuts] Ternary ... again

2018-08-15 Thread 'Axel Wagner' via golang-nuts
Hi, On Wed, Aug 15, 2018 at 1:23 PM Mark Volkmann wrote: > I understand that many requests for syntax additions are rejected on two > grounds. Really though, the reaction always happens on the same grounds: It is not shown that the benefit outweighs the cost. You mention the cost in your mess

Re: [go-nuts] Ternary ... again

2018-08-15 Thread peterGo
Mark, "Adding just a few things like these to the language might help with adoption and that in itself is a worthwhile goal. I suspect many developers that love Go aren’t currently using it on real projects. Getting more developers to consider Go makes that more likely." There are several fall

Re: [go-nuts] Ternary ... again

2018-08-15 Thread Mark Volkmann
I realize I’m just another new person to Go asking for features that have been discussed many times before and that are very unlikely to be changed. But I’d like to consider a kind of middle ground that applies to many potential features. I understand that many requests for syntax additions are

Re: [go-nuts] Ternary ... again

2018-08-14 Thread 'Axel Wagner' via golang-nuts
There is lots of discussion findable here: https://groups.google.com/forum/#!searchin/golang-nuts/ternary%7Csort:date There's a bit of discussion on the issue tracker: https://github.com/golang/go/issues?utf8=%E2%9C%93&q=ternary+operator -- in particular https://github.com/golang/go/issues/23248 Th

[go-nuts] Ternary ... again

2018-08-14 Thread Mark Volkmann
I’m new to Go and I imagine the idea of adding a ternary operator to Go has been discussed many times. Rather than repeat that, can someone point me to a discussion about why Go doesn’t add this? I’m struggling to understand why it is desirable to write code like this: var color if temperature