Modula-2 Reloaded

A Modern Typesafe & Literate Programming Notation

Site Menu

Project

Specification

Implementation

Recommendations

Reference

Needs Updating

Work in Progress

Wastebasket

Wiki Manual

edit SideBar

Import Aggregators

WiP.ImportAggregators History

Hide minor edits - Show changes to output

2015-09-20 17:40 by trijezdci -
Changed line 27 from:
*Advantages: Re-export is clearly visible and fully under library control. Allows combination of re-export and rebranded export.
to:
Advantages: Re-export is clearly visible and fully under library control. Allows combination of re-export and rebranded export.
2015-09-20 17:39 by trijezdci -
Changed lines 15-16 from:
To re-export an imported module, it might be marked with a re-export marker, such as an plus sign ...
to:
To re-export an imported module, it may be marked with a re-export marker, a trailing plus ...
Deleted line 27:
*Disadvantages: Although very minor, additional syntax is required.
2015-09-20 17:38 by trijezdci -
Changed line 12 from:
The following approach to import aggregation has been selected as a holding position:
to:
The following approach to import aggregation has been selected for adoption into the language:
2010-01-20 11:52 by benjk -
Changed lines 12-13 from:
The following approaches to import aggregation has been selected as a holding position:
to:
The following approach to import aggregation has been selected as a holding position:
Changed line 39 from:
   status : Collections.Status; (* only possible with explicit re-export approach *)
to:
   status : Collections.Status;
2010-01-20 11:51 by benjk -
Changed lines 12-30 from:
The following approaches are capable of achieving this:

!!!!Re-Export by Default
Any module
imported by a module might automatically be re-exported.

*Advantages: No additional syntax required
.
*Disadvantages: Re-export cannot be turned off.

!!!!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.@]

*Advantages: No additional syntax required.
*Disadvantages: Re-export will no longer work if the aggregate module is extended with declarations.
to:
The following approaches to import aggregation has been selected as a holding position:

!!!!Explicit Re-Export
To re-export an imported module, it might be marked with a re-export marker, such as an plus sign ...
2010-01-19 16:31 by benjk -
Changed line 37 from:
IMPORT CollectionStatus, Stack*, Queue+, BinarySearchTree+, Trie+, HashTable+, DynamicArray+;
to:
IMPORT CollectionStatus, Stack+, Queue+, BinarySearchTree+, Trie+, HashTable+, DynamicArray+;
2010-01-19 16:31 by benjk -
Changed lines 33-34 from:
To re-export an imported module, it might be marked with a re-export marker, such as an asterisk ...
to:
To re-export an imported module, it might be marked with a re-export marker, such as an plus sign ...
Changed line 37 from:
IMPORT CollectionStatus, Stack*, Queue*, BinarySearchTree*, Trie*, HashTable*, DynamicArray*;
to:
IMPORT CollectionStatus, Stack*, Queue+, BinarySearchTree+, Trie+, HashTable+, DynamicArray+;
2010-01-17 06:37 by benjk -
Changed line 45 from:
*Advantages: Allows combination of re-export and rebranded export. Re-export is clearly visible and fully under library control.
to:
*Advantages: Re-export is clearly visible and fully under library control. Allows combination of re-export and rebranded export.
2010-01-17 06:36 by benjk -
Changed line 6 from:
CONST Foo = OriginalExporter.Foo;  (* exported as ReExporter.Foo *)
to:
CONST Foo = OriginalExporter.Foo;  (* re-export as ReExporter.Foo *)
2010-01-17 06:35 by benjk -
Changed lines 37-38 from:
IMPORT Stack*, Queue*, BinarySearchTree*, Trie*, HashTable*, DynamicArray*;
to:
IMPORT CollectionStatus, Stack*, Queue*, BinarySearchTree*, Trie*, HashTable*, DynamicArray*;
Added lines 41-42:
CONST Status = CollectionStatus.Status; (* re-export as Collections.Status *)
Changed line 45 from:
*Advantages: Re-export is clearly visible and fully under library control.
to:
*Advantages: Allows combination of re-export and rebranded export. Re-export is clearly visible and fully under library control.
Changed lines 55-57 from:
VAR stack : Stack;
to:
VAR
    stack : Stack;
    status : Collections.Status; (* only possible with explicit re-export approach *)
Changed line 60 from:
stack := Stack.New(size);
to:
stack := Stack.New(size, status);
2010-01-17 06:24 by benjk -
Changed line 1 from:
In both PIM and ISO Modula-2, imported identifiers may be re-exported by including them in a CONST declaration ...
to:
In both PIM and ISO Modula-2, imported identifiers may be re-exported by including them in a @@CONST@@ declaration ...
2010-01-17 06:23 by benjk -
Changed lines 1-3 from:
It is often desirable to import a group of modules with a single import statement, importing only a single identifier. The following approaches might be used to achieve this:

!!!!!Re-Export
by Default
to:
In both PIM and ISO Modula-2, imported identifiers may be re-exported by including them in a CONST declaration ...

[@DEFINITION MODULE ReExporter;

IMPORT OriginalExporter;
CONST Foo = OriginalExporter.Foo;  (* exported as ReExporter.Foo *)

END ReExporter.@]

However, there is no instrument to re-export identifiers without ''rebranding'' them. The ability to re-export a group of modules is desirable to allow the import of a library that consists of multiple modules using a single module identifier for the entire library.

The following approaches are capable of achieving this:

!!!!Re-Export by Default
Changed line 20 from:
!!!!!Implicit Re-Export
to:
!!!!Implicit Re-Export
Changed line 32 from:
!!!!!Explicit Re-Export
to:
!!!!Explicit Re-Export
Changed line 46 from:
!!!!!Importing the Aggregator
to:
!!!!Importing the Aggregator
2010-01-17 06:04 by benjk -
Changed lines 6-8 from:
Advantages: No additional syntax required.
Disadvantages: Re-export cannot be turned off.
to:
*Advantages: No additional syntax required.
*Disadvantages: Re-export cannot be turned off.
Changed lines 18-20 from:
Advantages: No additional syntax required.
Disadvantages: Re-export will no longer work if the aggregate module is extended with declarations.
to:
*Advantages: No additional syntax required.
*Disadvantages: Re-export will no longer work if the aggregate module is extended with declarations.
Changed lines 32-33 from:
Advantages: Re-export is clearly visible and fully under library control.
Disadvantages: Although very minor, additional syntax is required.
to:
*Advantages: Re-export is clearly visible and fully under library control.
*Disadvantages: Although very minor, additional syntax is required.
2010-01-17 06:04 by benjk -
Added lines 6-8:
Advantages: No additional syntax required.
Disadvantages: Re-export cannot be turned off.

Added lines 18-20:
Advantages: No additional syntax required.
Disadvantages: Re-export will no longer work if the aggregate module is extended with declarations.

Added lines 31-33:

Advantages: Re-export is clearly visible and fully under library control.
Disadvantages: Although very minor, additional syntax is required.
2010-01-16 18:53 by benjk -
Changed lines 4-5 from:
Any item imported by a module might automatically be re-exported.
to:
Any module imported by a module might automatically be re-exported.
Changed lines 7-8 from:
A definition part which imports one or more items but exports no items on its own might be deemed to have the purpose of re-exporting all the imported items ...
to:
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 ...
Changed line 27 from:
Importing @@Collections@@ would then bring all re-exported items into scope ...
to:
Importing @@Collections@@ would then bring all re-exported modules into scope ...
2010-01-16 18:25 by benjk -
Changed line 22 from:
(* CONST, VAR, TYPE, PROCEDURE definitions *)
to:
(* CONST, VAR, TYPE, PROCEDURE declarations *)
2010-01-16 18:23 by benjk -
Changed line 1 from:
It is sometimes desirable to import a group of modules with a single import statement, importing only a single identifier. The following approaches might be used to achieve this:
to:
It is often desirable to import a group of modules with a single import statement, importing only a single identifier. The following approaches might be used to achieve this:
2010-01-16 17:56 by benjk -
Changed lines 6-8 from:
!!!!!Explicit Re-Export
To re-export an imported module, it might be marked with a re-export marker, such as an asterisk ...
to:
!!!!!Implicit Re-Export
A definition part which imports one or more items but exports no items on its own might be deemed to have the purpose of re-exporting all the imported items ...
Changed lines 11-14 from:
IMPORT Stack*, Queue*, BinarySearchTree*, Trie*, HashTable*, DynamicArray*;

(* CONST, VAR, TYPE, PROCEDURE definitions *)

to:
IMPORT Stack, Queue, BinarySearchTree, Trie, HashTable, DynamicArray;
Changed lines 15-17 from:
!!!!!Implicit Re-Export
A definition part which imports one or more items but exports no items on its own might be deemed to have the purpose of re-exporting all the imported items ...
to:
!!!!!Explicit Re-Export
To re-export an imported module, it might be marked with a re-export marker, such as an asterisk ...
Changed lines 20-22 from:
IMPORT Stack, Queue, BinarySearchTree, Trie, HashTable, DynamicArray;
to:
IMPORT Stack*, Queue*, BinarySearchTree*, Trie*, HashTable*, DynamicArray*;

(* CONST, VAR, TYPE, PROCEDURE definitions *)
2010-01-16 17:55 by benjk -
Changed line 3 from:
!!!!!Reexport by Default
to:
!!!!!Re-Export by Default
2010-01-16 17:55 by benjk -
Added lines 2-4:

!!!!!Reexport by Default
Any item imported by a module might automatically be re-exported.
2010-01-16 17:52 by benjk -
Changed line 36 from:
END Collections.@]
to:
END UseCollections.@]