Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision |
symbol_substitution [2018/11/19 23:54] – Add section for ampersand string substitution lricker | symbol_substitution [2018/11/19 23:55] – lricker |
---|
* Symbols preceded by single apostrophes (not in double-quotes: ''tick-varname-tick'') are translated //iteratively//; symbols preceded by double apostrophes (as in double-quotes ''"tick-tick-varname-tick"'') are not (substitution inside of double-quotes is once-only, when encountered). | * Symbols preceded by single apostrophes (not in double-quotes: ''tick-varname-tick'') are translated //iteratively//; symbols preceded by double apostrophes (as in double-quotes ''"tick-tick-varname-tick"'') are not (substitution inside of double-quotes is once-only, when encountered). |
| |
* DCL performs iterative substitutions in multiple phases or passes (for a given construct like ''&P'COUNT'''): First, any and all single-tick-mark substitutions (''tick-variable-tick'') are done -- yes, an early string substitution could result in a subst-value which itself is single-tick-mark surrounded, hence iterative substitution (very rarely done, and confusing!); then, finally, the ''&''-substitution is done on whatever symbols (variable) name results from the earlier substitution. (Confused yet? Take fresh courage: this is a rare use case!) | * DCL performs iterative substitutions in multiple phases or passes (for a given construct like ''&P'COUNT'''): First, any and all single-tick-mark substitutions (''tick-variable-tick'') are done -- yes, an early string substitution could result in a subst-value which itself is single-tick-mark surrounded, hence iterative substitution (very rarely done, and confusing!); then, finally, the ''&''-substitution is done on whatever symbols (variable) name results from the earlier substitution. (Confused yet? Take fresh courage: this is a rarely used feature of DCL!) |
| |
The upshot of this is simply that the ''&''-substitution operator delays its own substitution until any and all earlier tick-mark-substitutions have been done. So, looking again at the previous example: | The upshot of this is simply that the ''&''-substitution operator delays its own substitution until any and all earlier tick-mark-substitutions have been done. So, looking again at the previous example: |