From Modula-2 Reloaded

Wastebasket: Import Aggregators

The following two approaches to import aggregation were discussed and rejected:

Re-Export by Default

Any module imported by a module might automatically be re-exported.

Implicit Re-Export

A definition part which imports one or more modules but exports no items on its own might be deemed to have the purpose of re-exporting all the imported modules ...

DEFINITION MODULE Collections;

IMPORT Stack, Queue, BinarySearchTree, Trie, HashTable, DynamicArray;

END Collections.

Importing the Aggregator

Importing Collections brings all re-exported modules into scope ...

MODULE UseCollections;

IMPORT Collections;

VAR
    stack : Stack;
...

stack := Stack.New(size, status);
...

END UseCollections.
Retrieved from http://modula-2.net/m2r10/pmwiki.php?n=Wastebasket.ImportAggregators
Page last modified on 2010-01-20 11:50