Writing Real Programs in DCL, Second Edition

Chapter 5: Substitution

Overview

UP TO THIS POINT, the book has focused on DCL language features that are similar to those found in conventional languages. The similarity fades, however, with the introduction of a powerful feature called substitution. The substitution facility is akin to macros in assembly language or preprocessor definitions in the C language. However, substitution in DCL is unrelated to the syntax of commands: it is purely textual replacement. Any part of a command, from a single character to a portion of a file specification to an entire command line, can be created on the fly by the appropriate use of substitution. This is an extremely potent feature, which allows you to create DCL commands "customized" for particular circumstances. It also grants you the power to create malformed or completely garbled commands.

DCL provides three kinds of substitution: apostrophe substitution, implicit substitution, and ampersand substitution. The principle underlying all three kinds is that a symbol or lexical function appearing in a command is removed and replaced with its value. The differences among the three kinds of substitution lie in how they are specified and when they occur.

5.1 Apostrophe Substitution

This section describes apostrophe substitution, which is one form of explicit substitution. Using an apostrophe ( '), you explicitly request that DCL perform a substitution where it would not otherwise do so. (In contrast, the next section describes substitution that DCL performs automatically.) Apostrophe substitution occurs after a command is read but before it is analyzed and executed.

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Drilling and Tapping End Effectors
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.