News for hackers. Stuff that matters.
Re:Implemented proposals for Swift 3 by saturncoleus on Sunday May 08, 2016 @01:36AM (#11652775)
If you don't care about side effects:

C:

    int foo = bar ? 2 : 4;
Go:

    foo := map[bool]int{true:2, false:4}[bar]
Python had a similar trick before 2.5 added ternary conditionals.

There are no comments on this comment yet.