On Sep 22, 2013, at 5:27 PM, SiegeLord <slab...@aim.com> wrote: > On 09/22/2013 07:45 PM, Kevin Ballard wrote: >> It would require changing the rules for lifetimes, with no benefit (and no >> clear new rule to use anyway). &'foo"delim" is perfectly legal today, and I >> see no reason to change that. > It's not as big a change as you make it out to be, but fair enough. > > Looking at the parser right now, it seems to me that implementing the leading > 'R' in C++'s syntax will be just as difficult/easy as doing my > delim"stuff"delim proposal so I'm sticking to that idea as my 'vote'.
With C++11 syntax, `R"foo` is very obviously the start of a raw string. With your syntax, what about `add"foo`? Is that obviously the start of a raw string, or did the user just forget to type the ( in their function call? They may look the same to a lexer, but I think that being very clear about what starts the raw string is beneficial for reading. > If C++ way is chosen, I'd suggest the following permutation of the > delimeters, as I think it looks lighter (by virtue of using smaller > characters): > > r'delim"raw string"delim' > r'"raw string"' I'd really rather not overload the meaning of the ' character, if at all possible. Right now it's used for lifetimes, and character literals. Expanding it to also be used in string literals just feels like unnecessary overloading. We already have a perfectly good " that means string literal. I suppose you could flip that to r"delim'raw string'delim" or r"'raw string'". I just don't see why that's any better than R"delim(raw string)delim" or R"(raw string)". Especially in the r"'raw string'" case, having lots of little tick marks in a row takes more effort to visually distinguish. I suppose r"(raw string)" is an option, but if we're that close to C++11 we may as well just go whole hog and be consistent with their syntax. -Kevin _______________________________________________ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev