MAD (programming Language) - Operator Definition and Redefinition

Operator Definition and Redefinition

One of the most interesting features in MAD is the ability to extend the language by redefining existing operators, defining new operators, or defining new data types (modes). The definitions are made using MAD declaration statements and assembly language mnemonics included following the declaration up to the END pseudo-instruction that implement the operation.

  • DEFINE BINARY OPERATOR defined-op, PRECEDENCE rank existing-op MODE STRUCTURE mode-options
  • DEFINE UNARY OPERATOR defined-op, PRECEDENCE rank existing-op MODE STRUCTURE mode-options
  • MODE STRUCTURE mode-no = mode-no existing-op mode-no
  • MODE STRUCTURE mode-no = mode-no existing-op mode-no SAME SEQUENCE AS mode-no existing-op mode-no

where:

  • rank is one of SAME AS, LOWER THAN, or HIGHER THAN; and
  • mode-options are the options that appear on the MODE STRUCTURE statement.

Three pre-defined packages of definitions (MATRIX, DOUBLE PRECISION, and COMPLEX) are available for inclusion in MAD source programs using the INCLUDE statement.

  • INCLUDE package

Read more about this topic:  MAD (programming Language)

Famous quotes containing the word definition:

    Beauty, like all other qualities presented to human experience, is relative; and the definition of it becomes unmeaning and useless in proportion to its abstractness. To define beauty not in the most abstract, but in the most concrete terms possible, not to find a universal formula for it, but the formula which expresses most adequately this or that special manifestation of it, is the aim of the true student of aesthetics.
    Walter Pater (1839–1894)