GT.M Parameter Passing Extensions

The standard does not provide for indirection of a labelref because the syntax has an ambiguity.

Example:

          DO @X(1)
        

This example could be:

GT.M processes the latter interpretation as illustrated in the following example.

Example:

The syntax:

       SET A(1)="CUBE",X=5
       DO @A(1)(.X)
       WRITE X,!
       QUIT
       CUBE(C);cube a variable
       SET C=C*C*C
       QUIT
        

Produces the result:

          125
        

GT.M follows analogous syntax for routine indirection:

DO ^@X(A) invokes the routine specified by X(A).

DO ^@(X)(A) invokes the routine specified by X and passes the parameter A.

DO ^@X(A)(A) invokes the routine specified by X(A) and passes the parameter A.