5 ms·
Hi there! I'm the lang designer and i wrote up that spec. Could you clarify what you didn't understand about the indentation examples? I can work on clarifyi
by Metasyntactic 5y ago
Hi there! I'm the lang designer and i wrote up that spec. Could you clarify what you didn't understand about the indentation examples? I can work on clarifying them. Thanks!
- intrasight 5y agoYou say "If the indentation behavior is not desired, it is also trivial to disable like so:" And the code sample you show differs only in that closing quote isn't indented. You don't explain why and how that change would affect the generated string.
- jodrellblank 5y agoIt says “these string literals will naturally remove the indentation specified on the last line when producing the final literal value.” Each line in the literal will have leading whitespace trimmed off, up to where the closing quotes are. (What happens if the closing quotes pass some of the text?)
- Metasyntactic 5y ago> (What happens if the closing quotes pass some of the text?) That's an error. Called out here: https://github.com/dotnet/csharplang/blob/main/proposals/raw-string-literal.md#example-4---end-delimiter-after-start-delimiter https://github.com/dotnet/csharplang/blob/main/proposals/raw...
- Metasyntactic 5y ago>And the code sample you show differs only in that closing quote isn't indented. You don't explain why and how that change would affect the generated string. Hi there. This is explained in the spec in a few places. In the examples section it explicitly states: > To make the text easy to read and allow for indentation that developers like in code, these string literals will naturally remove the indentation specified on the last line when producing the final literal value. > If the indentation behavior is not desired, it is also trivial to disable like so: I thought that was clear as the prior explanation says that we remove the indentation from teh last line. And then i show how you can disable it. Specifically, as you noted because the closing quote line is no longer indented. Cheers!
- intrasight 5y agoI really don't like the idea of using whitespace semantically like this. I don't think it's going to get traction in C#.