Re:The Idea of Lisp
by vertex-four on Friday December 16, 2016 @01:27PM
(#13195468)
a and b have to be defined before the statement containing the terniary expression here. And the point is that you can embed arbitrary multi-statement logic in your if expressions in Rust in the same way you'd do it anywhere else.
x = something ? ((a=foo()), baz(a)) : ((b = bar()), baz(b));
Otherwise:
x = something ? baz(foo()) : baz(bar());