4 ms·
Postscript uses parentheses: (Good bye (cruel) world!) show showpage prints "Good bye (cruel) world!". Common Lisp uses | to quote symbol names: (pr
by informatimago 13y ago
Postscript uses parentheses:
(Good bye (cruel) world!) show showpage
prints "Good bye (cruel) world!".
Common Lisp uses | to quote symbol names:
(print '|Hello World!|)
prints: "Hello World!"
But in all cases, (whatever the advantages of using rare, or balanced characters to quote strings), eventually you will need to insert one of those characters in a string, so you will need an escape mechanism anyways. It is not hard to understand. On the contrary, as soon as you need to quote text, you can instructively introduce this escape mechanism to quote the quoting character.
"Hello ""small"" world!"
"Hello \"small\" world!"
|A string with a \| in it.|
(There are two things: 1\) the one, and 2\) the second.)
etc.
- Turing_Machine 13y agoWell, yeah, he mentions that. The point is that you typically need to use " and ' in text strings incredibly more often than you need to use | in them. It would be interesting to run some stats on github to determine how many person-years would be saved by not having \' and \" all over the place (not to mention the improved readability).