#C Sharp Raw String Literals

17 messages · Page 1 of 1 (latest)

glass venture
#

just saw this proposal

static arrow
#

I like the idea that it features https://docs.rs/indoc logic in and of itself, but I do believe that there are use cases where that's desirable, and others where it isn't. So I like that Rust has the latter, I'd just wish there be a raw string literal modifier to opt into the former

#

Although I have to admit that using the end of the string literal as a heuristic to guess the caller's intent is quite nifty. It won't cover 100% of use cases, but it will be a very handy an intuitive way of supporting 99.9%, while still having a convoluted way to write the 0.01% remaining percent (using concat!, or something like that).

quartz shadow
#

this is so neat

glossy patrol
#

I like it, but I don't like that """"<- this should be in the string""" won't work for obvious reasons

opaque shell
#

I definitely prefer rust's take, of using an unambiguous prefix to the opening quote.

#

I think it would be nice to have both "strings that can contain unescaped quotes but aren't raw" and "raw strings" as options in rust, like idk an s#"I'm not a "raw string"\nSo I contain a literal newline. But I can still contain unescaped quotes"# in addition to the usual raw strings.

#

(not an actual proposal for the syntax, I like the idea of eventually having something like s"" as Strings. I wonder if you could just do ##"some "string" here"## without needing a letter prefixing the whole construct, or if that would lead to ambiguity in parsing)

static arrow
opaque shell
#

I'm unfortunately unfamiliar with the image you're referring to, at least by that description

#

Ah yep

deep scarab
#

?play rs let lit = r###"hello """ ## """" world "###; println!("{lit}");

sand houndBOT
#
hello """ ## """" world