News for hackers. Stuff that matters.
Re:Ask HN: Why golang doesn't have ternary operator? by kazinator on Saturday June 02, 2018 @10:07AM (#17214635)
Lisp is unambiguous, whereas:

   x = a ? b : c;
Oops; that assigns x = a, and tests it. Not if that = is that of an initializer, though:

   int x = a ? : b : c;
so now we have an expression that changes meaning if we have to split the initialization off into an assignment.

You're often better off if you put it behind a macro:

  #define IF(X, Y, Z) ((X) ? (Y) : (Z))
In C coding, a lot of ternary action happens behind the curtain of preprocessing, where expression is almost fully parenthesized.
Re:Ask HN: Why golang doesn't have ternary operator? by pcvarmint on Sunday June 03, 2018 @04:04AM (#17218484)
C non-sequitor. Assignment is always lower in precedence than conditional expressions.

CPP macros is red herring.