In Quoting constructs§

See primary documentation in context for Literal strings: Q

Q[A literal string]
More plainly.
Q^Almost any non-word character can be a delimiter!^
QDelimiters can be repeated/nested if they are adjacent.
QQuoting with fancy unicode pairs

Delimiters can be nested, but in the plain Q form, backslash escapes aren't allowed. In other words, basic Q strings are as literal as possible.

Some delimiters are not allowed immediately after Q, q, or qq. Any characters that are allowed in identifiers are not allowed to be used, since in such a case, the quoting construct together with such characters are interpreted as an identifier. In addition, ( ) is not allowed because that is interpreted as a function call. If you still wish to use those characters as delimiters, separate them from Q, q, or qq with a space. Please note that some natural languages use a left delimiting quote on the right side of a string. Q will not support those as it relies on unicode properties to tell left and right delimiters apart.

Q'this will not work!'
Q(this won't work either!)

The examples above will produce an error. However, this will work

Q (this is fine, because of space after Q)
Q 'and so is this'
Q<Make sure you <match> opening and closing delimiters>
Q{This is still a closing curly brace → \}

These examples produce:

this is finebecause of space after Q
and so is this
Make sure you <match> opening and closing delimiters
This is still a closing curly brace → \

The behavior of quoting constructs can be modified with adverbs, as explained in detail in later sections.

ShortLongMeaning
:x:execExecute as command and return results
:w:wordsSplit result on words (no quote protection)
:ww:quotewordsSplit result on words (with quote protection)
:q:singleInterpolate \\, \qq[...] and escaping the delimiter with \
:qq:doubleInterpolate with :s, :a, :h, :f, :c, :b
:s:scalarInterpolate $ vars
:a:arrayInterpolate @ vars (when followed by postcircumfix)
:h:hashInterpolate % vars (when followed by postcircumfix)
:f:functionInterpolate & calls
:c:closureInterpolate {...} expressions
:b:backslashEnable backslash escapes (\n, \qq, \$foo, etc)
:to:heredocParse result as heredoc terminator
:v:valConvert to allomorph if possible

These adverbs can be used together with Q, so that it will interpolate even if the quoting operator does not:

my %þ = :is-mighty;
say Q "Þor %þ<>";                         # OUTPUT: «Þor %þ<>␤» 
say Q:h"Þor %þ<>";                        # OUTPUT: «Þor is-mighty   True␤» 
%þ = :42foo, :33bar;
say Q:h:c "Þor %þ<> →  { [+] %þ.values}"# OUTPUT: «Þor bar 33␤foo  42 →  75␤» 
my @þ= <33 44>say Q:a "Array contains @þ[]"# OUTPUT: «Array contains 33 44␤» 
say Q:v<33> + 3;                          # OUTPUT: «36␤» 

By default, and as shown, Q quotes directly without any kind of transformation of the quoted string. The adverbs will modify its behavior, converting, for instance, the string into an allomorph (with the :v adverb) or allowing interpolation of hashes (via :h) or {} code sections (via :c). Arrays and hashes must be followed by a postcircumfix; that is, the sigiled identifier will not interpolate, but followed by an indexing, decont operator or a method call with parentheses, it will:

my @þ= <33 44>;
say Q:a "Array contains @þ.elems()"# OUTPUT: «Array contains 2␤» 

The same code without the parentheses will simply not interpolate, absent the post-circumfix operator.