micropython

Change of docs/syspython.txt

644:81b95dd9c4f8
docs/syspython.txt syspython-as-target
     1.1 --- a/docs/syspython.txt	Fri Apr 19 22:15:02 2013 +0200
     1.2 +++ b/docs/syspython.txt	Fri Apr 19 23:38:12 2013 +0200
     1.3 @@ -73,7 +73,7 @@
     1.4          ...
     1.5          method = module.C.method
     1.6          if something:
     1.7 -            __storeaddress__(module.C, something)
     1.8 +            __storeattr__(module.C, something)
     1.9  
    1.10  Imports
    1.11  -------
    1.12 @@ -135,7 +135,7 @@
    1.13          __storelocal__(x, 1)
    1.14          __storelocal__(y, x)
    1.15          __storelocal__(a, b)
    1.16 -        __storeaddress__(module, g, f)
    1.17 +        __storeattr__(module, g, f)
    1.18  
    1.19  Names and Attributes
    1.20  --------------------
    1.21 @@ -146,7 +146,7 @@
    1.22  functions as follows:
    1.23  
    1.24      __storelocal__(name, value)
    1.25 -    __storeaddress__(module, name, value) # see below
    1.26 +    __storeattr__(module, name, value) # see below
    1.27  
    1.28  No operator usage: all operators are converted to invocations, including
    1.29  all attribute access except static references to modules or particular class
    1.30 @@ -171,17 +171,15 @@
    1.31  In general, attribute access must use an explicit function indicating the
    1.32  kind of access operation being performed. For example:
    1.33  
    1.34 -    __loadaddress__(obj, attrname)
    1.35 -    __loadaddresscontext__(obj, attrname)
    1.36 -    __loadaddresscontextcond__(obj, attrname)
    1.37 -    __loadattr__(obj, attrname)
    1.38 -    __loadattrindex__(obj, attrname)
    1.39 -    __loadattrindexcontext__(obj, attrname)
    1.40 -    __loadattrindexcontextcond__(obj, attrname)
    1.41 +    __loadattr__(obj, attrname)                 # preserve context
    1.42 +    __loadattrcontext__(obj, attrname)          # replace context with obj
    1.43 +    __loadattrcontextcond__(obj, attrname)      # run-time context decision
    1.44 +    __loadattrindex__(obj, attrname)            # preserve context
    1.45 +    __loadattrindexcontext__(obj, attrname)     # replace context with obj
    1.46 +    __loadattrindexcontextcond__(obj, attrname) # run-time context decision
    1.47  
    1.48 -    __storeaddress__(obj, attrname, value)
    1.49 -    __storeaddresscontext__(obj, attrname, value)
    1.50 -    __storeattr__(obj, attrname, value)
    1.51 +    __storeattr__(obj, attrname, value)         # preserve context
    1.52 +    __storeattrcontext__(obj, attrname, value)  # replace context
    1.53      __storeattrindex__(obj, attrname, value)
    1.54  
    1.55  Temporary variables could employ similar functions:
    1.56 @@ -234,4 +232,14 @@
    1.57      def fn_unchecked(self, ...):
    1.58          ...
    1.59  
    1.60 +The __jump__ function might also be used for inlining appropriate functions.
    1.61 +
    1.62  Exceptions must also be handled in the language.
    1.63 +
    1.64 +Object Type Detection
    1.65 +---------------------
    1.66 +
    1.67 +Occasionally, the type of an object (instance of a particular class, class,
    1.68 +and so on) needs to be determined at run-time:
    1.69 +
    1.70 +    __isclass__(obj)