1.1 --- a/docs/concepts.txt Sun Jul 08 21:01:52 2012 +0200
1.2 +++ b/docs/concepts.txt Sun Jul 08 21:13:39 2012 +0200
1.3 @@ -5,6 +5,7 @@
1.4
1.5 * Namespaces and attribute definition
1.6 * Attribute usage observations
1.7 + * Imports and circular import detection
1.8 * Contexts and values
1.9 * Tables, attributes and lookups
1.10 * Objects and structures
1.11 @@ -98,6 +99,32 @@
1.12 and class definition "locals" can be reliably employed in attribute usage
1.13 observations.
1.14
1.15 +Imports and Circular Import Detection
1.16 +=====================================
1.17 +
1.18 +The matter of whether any given module is potentially modified by another
1.19 +module before it has been completely imported can be addressed by separating
1.20 +the import process into distinct phases:
1.21 +
1.22 + 1. Discovery/loading
1.23 + 2. Parsing/structure processing
1.24 + 3. Completion/code processing
1.25 +
1.26 +Upon discovering a module, a test is made to determine whether it is already
1.27 +being imported; if not, it is then loaded and its structure inspected to
1.28 +determine whether it may import other modules, which will then in turn be
1.29 +discovered and loaded. Once no more modules can be loaded, they will then be
1.30 +completed by undergoing the more thorough systematic processing of each
1.31 +module's contents, defining program units and requesting the completion of
1.32 +other modules when import statements are encountered.
1.33 +
1.34 +The motivation for such a multi-phase approach is to detect circular imports
1.35 +in the structure processing phase before modules are populated and deductions
1.36 +made about their objects' behaviour. Thus, globals belonging to a module known
1.37 +to be imported in a circular fashion will already be regarded as potentially
1.38 +modifiable by other modules and attribute usage observations will not be
1.39 +recorded.
1.40 +
1.41 Contexts and Values
1.42 ===================
1.43