# HG changeset patch # User Paul Boddie # Date 1366407492 -7200 # Node ID 81b95dd9c4f8b07b61fc453970ec37f979317f14 # Parent 32134fe3d5b6de0941a7bb6695836330629845f2 Renamed various access functions and removed the distinction between address-based and object-relative access. Added context-related notes for each of the access functions. Added notes on object type detection. diff -r 32134fe3d5b6 -r 81b95dd9c4f8 docs/syspython.txt --- a/docs/syspython.txt Fri Apr 19 22:15:02 2013 +0200 +++ b/docs/syspython.txt Fri Apr 19 23:38:12 2013 +0200 @@ -73,7 +73,7 @@ ... method = module.C.method if something: - __storeaddress__(module.C, something) + __storeattr__(module.C, something) Imports ------- @@ -135,7 +135,7 @@ __storelocal__(x, 1) __storelocal__(y, x) __storelocal__(a, b) - __storeaddress__(module, g, f) + __storeattr__(module, g, f) Names and Attributes -------------------- @@ -146,7 +146,7 @@ functions as follows: __storelocal__(name, value) - __storeaddress__(module, name, value) # see below + __storeattr__(module, name, value) # see below No operator usage: all operators are converted to invocations, including all attribute access except static references to modules or particular class @@ -171,17 +171,15 @@ In general, attribute access must use an explicit function indicating the kind of access operation being performed. For example: - __loadaddress__(obj, attrname) - __loadaddresscontext__(obj, attrname) - __loadaddresscontextcond__(obj, attrname) - __loadattr__(obj, attrname) - __loadattrindex__(obj, attrname) - __loadattrindexcontext__(obj, attrname) - __loadattrindexcontextcond__(obj, attrname) + __loadattr__(obj, attrname) # preserve context + __loadattrcontext__(obj, attrname) # replace context with obj + __loadattrcontextcond__(obj, attrname) # run-time context decision + __loadattrindex__(obj, attrname) # preserve context + __loadattrindexcontext__(obj, attrname) # replace context with obj + __loadattrindexcontextcond__(obj, attrname) # run-time context decision - __storeaddress__(obj, attrname, value) - __storeaddresscontext__(obj, attrname, value) - __storeattr__(obj, attrname, value) + __storeattr__(obj, attrname, value) # preserve context + __storeattrcontext__(obj, attrname, value) # replace context __storeattrindex__(obj, attrname, value) Temporary variables could employ similar functions: @@ -234,4 +232,14 @@ def fn_unchecked(self, ...): ... +The __jump__ function might also be used for inlining appropriate functions. + Exceptions must also be handled in the language. + +Object Type Detection +--------------------- + +Occasionally, the type of an object (instance of a particular class, class, +and so on) needs to be determined at run-time: + + __isclass__(obj)