The matter of Representations and Values is too often
given short shrift in programming language manuals. The
HLASM reference is no better than average.
For example, in the statement:
&C SETC ''''
the four apostrophes on the right are the "representation"
of the "value", a single apostrophe, assigned to the LCLC
symbol, &C.
The conversion of representations to values is too much left
to lore and too little documented. Empirically, in the
statement:
DC C'A''B&C'
o First, the apostrophe following the "C" and the final apostrophe
(which must both be present) are removed.
o Then symbol substitution is performed.
o Then, in a left-to-right scan, paired apostrophes are reduced
to single apostrophes. Unpaired apostrophes cause syntax errors.
In actual parameters to macros:
o Symbol substitution is performed.
o The representation of the actual parameter after symbol
substitution becomes the value of the formal parameter.
Apostrophes need not be paired, but the entire number of
apostrophes must be even.
In the argument to the BIF, DOUBLE():
o Initial and final apostrophes (which must be present) are
removed.
o Remaining paired apostrophes are converted to single apostrophes.
(Are unpaired apostrophes at this point a syntax error?)
o Symbol substitution is performed.
o Now, single apostrophes are converted to double apostrophes.
o The representation so transformed is returned by the DOUBLE()
function as its value.
Etc.
(For brevity, I've omitted much discussion of ampersands.)
How much of this is truly explained in the Language Reference,
not relegated to lore, or "Everybody knows" (I don't), or
"It does what you would want it to" (mostly true, but DWIM is
subject to interpretation)?
-- gil