External Calls

GT.M supports the MDC Type A external call syntax. The external call syntax provides an externref that specifies a destination for subroutine invocation. The format for an externref is:

       &
        [packagename.]name[^name]
      

The externref is a two-part identification of a program entry point. The entry point can be in any language, including M. The packagename is a name following M rules that identifies a name-space within which the remainder of the externref, after the delimiting period (.), is unique. The portion of the externref after the delimiting period may be a single M name or two M names separated by a caret (^).

Example:

        SET X=$&MATH.NATRLOG(.Y)
      

This invokes the NATRLOG function in the MATH package and passes the value of Y by reference.

GT.M supports external calls to any language that supports the VAX calling standard. GT.M provides external call (ZCALL) tables to interface between the typeless data of M and the typed data supported by the VAX calling standard. ZCALL tables associate packagenames with groups of external routine definitions. Each external routine definition associates the name(s) within the package with an actual routine, and any parameters passed to or from the routine with data typing information. External routine definitions also permit reordering parameters from their presentation in M to the order used in the actual external routine call. For additional information on external call tables, refer to the "Integrating External Routines" chapter in this manual.

GT.M supports calls to M from an external routine that was itself called from M.

DO commands may specify an externref in place of an M entryref. Extrinsic functions and extrinsic special variables may specify an externref in place of a labelref.

The MDC Type A external call syntax replaces ZCALL, GT.M's implementation-specific method for making external calls. However, GT.M continues to support the ZCALL syntax.