[rust-dev] Why does string formatting in Rust have to be different from other languages?

2013-11-18 Thread Derek Chiang
Hi all, I'm a newcomer to Rust. One of the things that I find confusing is the use of {} in formatted strings. In all other languages I've ever used, it's always %. So instead of writing %d, you write {:d} in Rust. Why is this so? What benefits do we get? Thanks, Derek

Re: [rust-dev] Why does string formatting in Rust have to be different from other languages?

2013-11-18 Thread Daniel Micay
On Mon, Nov 18, 2013 at 2:02 AM, Derek Chiang derekchian...@gmail.com wrote: Hi all, I'm a newcomer to Rust. One of the things that I find confusing is the use of {} in formatted strings. In all other languages I've ever used, it's always %. So instead of writing %d, you write {:d} in

Re: [rust-dev] Why does string formatting in Rust have to be different from other languages?

2013-11-18 Thread Alex Crichton
Rust’s old fmt! syntax also used % instead of {}. The reason for the switch was to primarily support compatibility with an internationalization-style scheme of string formatting. The main benefit of {} of % is that you can nest {} inside of another format, whereas with % you’re limited to just