3 ms·
Double-backslash for multiline literals is standard Zig and it takes a bit of getting used to. I suspect I'll always find it ever-so-slightly unsatisfying beca
by samatman 2y ago
Double-backslash for multiline literals is standard Zig and it takes a bit of getting used to.
I suspect I'll always find it ever-so-slightly unsatisfying because I really want the token to be `\\ `, and it's just `\\`. I don't want those backslashes touching my text!
It's probably the better rule, I say, gritting my teeth slightly, because if you want the text indented, let's say four spaces, making sure it's actually five is annoying and easy to forget. But ugh I don't like looking at unindented multi-line Zig text. Imagine leaving no space between `//` and a comment, I would never. Never!
Eh. You get used to it.
- thefaux 2y agoIn the language I've implemented, I use significant whitespace for multiline strings and no leader is necessary. Having a leader almost defeats the purpose of multiline string syntax for me.
- codetrotter 2y ago> Imagine leaving no space between `//` and a comment, I would never. Never! I usually do this when I out-comment single lines of code. That way I can grep for `//[^ ]` to find lines that are out-commented code, as opposed to being actual comments for humans. It also helps the readability in the case where a comment for humans is followed by out-commented code, to distinguish where the comment for human ends.