Limbo source programs that implement modules are stored in files, conventionally named with the suffix .b. Each such file begins with a single implement directive naming the type of the module being implemented, followed by a sequence of declarations. Other files, conventionally named with the suffix .m, contain declarations for things obtainable from other modules. These files are incorporated by an include declaration in the implementation modules that need them. At the top level, a program consists of a sequence of declarations. The syntax is
program: implement identifier ; top-declaration-sequence top-declaration-sequence: top-declaration top-declaration-sequence top-declaration top-declaration: declaration identifier-list := expression ; identifier-list = expression ; ( identifier-list ) := expression ; module-declaration function-definition adt-declaration
Declarations are used both at the top level (outside of functions) and also inside functions and module declarations. Some styles of declaration are allowed only in certain of these places, but all will be discussed together.