CLU (programming Language) - Clusters

Clusters

The syntax of CLU was based on ALGOL, then the starting point for most new language design. The key addition was the concept of a cluster, CLU's type extension system and the root of the language's name (CLUster). Clusters correspond generally to the concept of an "object" in an OO language, and have roughly the same syntax. For instance, here is the CLU syntax for a cluster that implements complex numbers:

complex_number = cluster is add, subtract, multiply, ... rep = record add = proc ... end add; subtract = proc ... end subtract; multiply = proc ... end multiply; ... end complex_number;

Cluster names are global, and no namespace mechanism was provided to group clusters or allow them to be created "locally" inside other clusters.

CLU does not perform implicit type conversions. In a cluster, the explicit type conversions 'up' and 'down' change between the abstract type and the representation. There is a universal type 'any', and a procedure force to check that an object is a certain type. Objects may be mutable or immutable, the latter being "base types" such as integers.

Read more about this topic:  CLU (programming Language)

Famous quotes containing the word clusters:

    What wondrous life in this I lead!
    Ripe apples drop about my head;
    The luscious clusters of the vine
    Upon my mouth do crush their wine;
    The nectarine and curious peach
    Into my hands themselves do reach;
    Stumbling on melons, as I pass,
    Ensnared with flowers, I fall on grass.
    Andrew Marvell (1621–1678)

    Where we such clusters had,
    As made us nobly wild, not mad;
    And yet each verse of thine
    Outdid the meat, outdid the frolic wine.
    Robert Herrick (1591–1674)