Just to make sure - how does the C++ syntax behave in the presence of line
breaks? Specifically, what does it do with leading (and trailing) white
space of each line? My guess is that they would be included in the string,
is that correct?

At any rate, having some sort of here documents would be very nice. The C++
syntax is reasonable, though I really don't have a strong preference here.
It might be more Rust-ish to use a macro notation instead:
str!(delimiter"....."delimiter), or something like that.

BTW, I found myself creating (in several languages) an "unindent" string
function that would (1) if the string starts with a line break, remove it;
(2) remove the leading white space of the 1st line from all the lines.
Applying this to "here documents" allows indenting them together with the
code that includes them. In Rust, the downside of this approach is that the
result isn't &'static any more... Not that this warrants making such
complex functionality a built-in of the syntax, of course.

Oren.
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to