Literals/String: Difference between revisions

Added Quackery.
m (Regularize non-standard header markup - Fix some Perl 6 -> Raku names)
(Added Quackery.)
Line 2,080:
They are terminated by unescaped triple quotes of the same type that initiated the expression.
They are generally used for "doc strings" and other multi-line string expressions --- and are useful for "commenting out" blocks of code.
 
=={{header|Quackery}}==
 
A character literal is denoted by the word <code>char</code>. The character is the first non-whitespace character following <code>char</code>.
 
A string literal is denoted by the word <code>$</code>. The string is delimited by the first non-whitespace character following <code>$</code>.
 
Character and string literals illustrated in the Quackery shell (REPL).
<pre>O> char X emit
... char Y emit
... char Z emit cr
... $ "This is a 'string'." echo$ cr
... $ 'This is a "string" too.' echo$ cr
... $ ~This is one with "quotes" and 'apostrophes'.~ echo$ cr
... $ \Any non-whitespace character can be the delimiter.\ echo$ cr
...
XYZ
This is a 'string'.
This is a "string" too.
This is one with "quotes" and 'apostrophes'.
Any non-whitespace character can be the delimiter.
</pre>
 
 
=={{header|R}}==
1,462

edits