String interpolation / template literals like JS?


#21

He is saying that you can’t do something like,

let x = Y { 10, 20, 30 };

but you can do

println!("{}{}{}", 10, 20, 30);

#22

But wouldn’t a better comparison be with println!("{a}{b}{c}", ...)?


#23

Which you can do, but you have to then write println!("{a}{b}{c}", a=a, b=b, c=c);. You can’t just write println!("{a}{b}{c}", a, b, c);.

In theory we could allow that, but we don’t today.