1.1 --- a/docs/concepts.txt Tue Apr 07 00:57:04 2009 +0200
1.2 +++ b/docs/concepts.txt Mon Apr 20 01:50:00 2009 +0200
1.3 @@ -1,12 +1,33 @@
1.4 Concepts
1.5 ========
1.6
1.7 +This document describes the underlying concepts employed in micropython.
1.8 +
1.9 + * Namespaces and attribute definition
1.10 * Contexts and values
1.11 * Tables, attributes and lookups
1.12 * Objects and structures
1.13 * Parameters and lookups
1.14 * Instantiation
1.15
1.16 +Namespaces and Attribute Definition
1.17 +===================================
1.18 +
1.19 +Namespaces are any objects which can retain attributes.
1.20 +
1.21 + * Module attributes are defined either at the module level or by global
1.22 + statements.
1.23 + * Class attributes are defined only within class statements.
1.24 + * Instance attributes are defined only by assignments to attributes of self
1.25 + within __init__ methods.
1.26 +
1.27 +These restrictions apply because such attributes are thus explicitly declared,
1.28 +permitting the use of tables (described below). Module and class attributes
1.29 +can also be finalised in this way in order to permit certain optimisations.
1.30 +
1.31 +See rejected.txt for complicating mechanisms which could be applied to
1.32 +mitigate the effects of these restrictions on optimisations.
1.33 +
1.34 Contexts and Values
1.35 ===================
1.36
1.37 @@ -56,10 +77,9 @@
1.38 LoadConst Load class, function, Combine null context with
1.39 module, constant loaded object
1.40
1.41 - LoadAddress Load attribute from Preserve or override stored
1.42 - LoadAddressContext class, module, context (as described in
1.43 - LoadAttr instance assignment.txt)
1.44 - LoadAttrIndex
1.45 + LoadAddress* Load attribute from Preserve or override stored
1.46 + LoadAttr* class, module, context (as described in
1.47 + instance assignment.txt)
1.48
1.49 In order to comply with traditional Python behaviour, contexts may or may not
1.50 represent the object from which an attribute has been acquired.