3 ms·
A modest proposal… Instead of having println() or it’s equivalent in your programming language, add a new special character that denotes a newline after a stri
by fijiaarone 1y ago
A modest proposal…
Instead of having println() or it’s equivalent in your programming language, add a new special character that denotes a newline after a string:
print(“Hello world”.)
- coderedart 1y agoThat would mess with dot syntax usually reserved for method calls. Like rust's "hello".to_string();
- cxr 1y agoOberon doesn't have string methods (and people who opt not to parenthesize for cases like that deserve the punishment).
- Jtsummers 1y agoIs your idea that that would always work? Like: s := "Hello world".; -- equivalent to "Hello world\n" Or only in `print`? If only in `print`, then you've suddenly made a context-sensitive grammar. And if the former, just use "Hello world\n" instead, since the tokenizer already supports that.
- keithnz 1y agoI think the point is to add the correct end of line depending on OS.
- kouteiheika 1y agoThe correct end of line is always '\n'. Even Windows' Notepad supports it nowadays. I will gladly die on this hill. :P