Commenter cites Haskell precedent for multiline string handling
7 Sep 22 8:28 PM · 1d ago · 1 comment · 1 source · development 7 of 7
A reader points to Haskell's existing approach to multiline strings using backslash delimiters, offering a simpler historical example of the problem the post addresses.
Blog author Programming language designer/writer
The whole story postscomments the bright band is this development · numbered dots are the others · click one to jump
What people said 7 voices · verbatim
-
You will be disgusted by how we use `;` in programming languages.
-
I went the 2nd path in zukte, and I'm still happy with the result. Separating the namespace of language keywords & features from user-defined variables makes it clearer (especially to new coders) what's happening. You get used to the sigils the same way you got used to them in basic and perl. ``` if @player.wizard then print "There's a wizard…
-
> but I kind of wonder how much actual value it provides Boldface in Algol 60 and 68 allows the languages to be sure that a keyword is not part of an identifier. In Algol, you can insert spaces anywhere in an identifier and it is treated the same. So, “print operand” and “printoperand” are the same name, and they don’t contain the keywords…
-
Yup. Don't begin your design by purposefully pissing off 99.9% of your future users. Related:
-
Early Fortran (late 1950's) ignored spaces, except in string literals. The language was specified before it was implemented, and I'm sure this sounded like a great idea at the time. On the one hand, you were using 80 column punch cards to input Fortran programs, and leaving out spaces allowed you to get more code onto a card. On the other hand…
-
Hm, this looks fairly different to me... Besides indentation, the other main perk of the `\\` syntax is that every character (sans newlines) appears literally, i.e., you can copy-paste *any* text file into your codebase, tell your editor to prefix each line with `\\`, and indent it to whatever level you want. This property isn't upheld by any…
-
Haskell has actually had something not dissimilar for a very long time (it was already in Haskell98 and I'm too lazy to go back further): ``` foo = "hello!\n\ \this is a multiline \ \string" ``` which is equivalent to `foo = "hello!\nthis is a multiline string"`. The need to add manual `\n` is a bit finicky but it's very simple. You can indent…
All 7 developments of Blog post on programming language design principles gains… →
LobstersHacker News