On Friday, 3 June 2022 at 18:33:57 UTC, Jack wrote:
>Rust does support it like that:
const limit:i32 = 30;
let n = 10;
let mut r = if n > limit { "big" } else { "small "};
println!("{} is {} than {}", n, r, limit);
do you think would be nice that in D as well? I find it can increase code reability...
I like the Python version of it with is reordered compared to Rust/D:
num_type = "even" if a % 2 = 0 else "odd"