3 ms·
The only languages I know off the top of my head that use balanced delimiters for strings are M4 and Perl 6. Hey, imagine being able to nest strings without es
by mbrock 9y ago
The only languages I know off the top of my head that use balanced delimiters for strings are M4 and Perl 6.
Hey, imagine being able to nest strings without escaping! What a concept!
- chaosfox 9y agoPerl does that as well, and you can even choose the delimiters you wanna use: > For the constructs except here-docs, single characters are used as starting and ending delimiters. If the starting delimiter is an opening punctuation (that is (, [, {, or < ), the ending delimiter is the corresponding closing punctuation (that is ), ], }, or >). If the starting delimiter is an unpaired character like / or a closing punctuation, the ending delimiter is the same as the starting delimiter. Therefore a / terminates a qq// construct, while a ] terminates both qq[] and qq]] constructs.
- jstimpfle 9y agoNot a language, but I adopted this concept as well: http://jstimpfle.de/projects/wsl/main.html http://jstimpfle.de/projects/wsl/main.html And I guess you could count HTML in, too.
- stevelosh 9y agoCommon Lisp doesn't have it built in, but the cl-interpol library adds this (and you can add your own custom delimiters too). http://weitz.de/cl-interpol/#syntax http://weitz.de/cl-interpol/#syntax
- kazinator 9y agoPostScript! It uses (...) for strings. Nesting string literals without escaping is a somewhat poor concept, though. Firstly, what does that even mean? Given `abc `def' ghi', what is the string here? Is it abc def ghi or is it abc `def' ghi? Secondly, what if I want to just have an unbalanced ` character in the string data?