[Contents]
[Prev] [Next] [Limbo Basics] [Limbo Programming] [Language Definition]

Constant Declarations

The con declaration

identifier-list : con expression;

declares a name (or names) for constants. The expression must be constant. After the declaration, each identifier can be used anywhere a constant of the appropriate type is needed. The type is taken from the type of the constant. For example, after

Seven : con 3+4;

the name Seven is exactly the same as the constant 7.

The identifier iota has a special meaning in the expression in a con declaration. It is equivalent to the integer constant 0 when evaluating the expression for the first (leftmost) identifier declared, 1 for the second, and so on numerically. For example, the declaration:

M0, M1, M2, M3, M4 : con (1<<iota);

declares several constants M0 through M4 with the values 1, 2, 4, 8, 16 respectively. The identifier iota is not reserved except inside the expression in the con declaration.



[Contents]
[Prev] [Next] [Limbo Basics] [Limbo Programming] [Language Definition]

Copyright © 1998, Lucent Technologies, Inc. All rights reserved.