diff options
author | P. J. McDermott <pj@pehjota.net> | 2016-03-23 11:44:00 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2017-02-08 18:19:40 (EST) |
commit | abf7a2bee69142d4fe5272e1569dea4f70455702 (patch) | |
tree | 9fdbd1d428b12e22b328f760d9a411d8c5767da7 | |
parent | 8a89e73a757c8dbc8c0091399f1d406e67ebf3e8 (diff) | |
download | eggshell-abf7a2bee69142d4fe5272e1569dea4f70455702.zip eggshell-abf7a2bee69142d4fe5272e1569dea4f70455702.tar.gz eggshell-abf7a2bee69142d4fe5272e1569dea4f70455702.tar.bz2 |
research/oop.txt: New file
-rw-r--r-- | research/oop.txt | 135 |
1 files changed, 135 insertions, 0 deletions
diff --git a/research/oop.txt b/research/oop.txt new file mode 100644 index 0000000..a23546c --- /dev/null +++ b/research/oop.txt @@ -0,0 +1,135 @@ +Class member declarations +========================= + +Public member declaration +------------------------- + +Public static member declaration +-------------------------------- + +Private member declaration +-------------------------- + +Private static member declaration +--------------------------------- + +Object Member Access Operations +=============================== + +Lvalue Assignment +----------------- + +Implementation: + + # High level + array_set ${obj} mbr ${val} + # Low level + eval __arr_${obj}_mbr'=${val}' + +Syntax: + + obj->mbr=${val} + +Explanation: + +`->` dereferences/expands `obj` and accesses the `mbr` lvalue, as in the +following (unsupported) syntax: `${obj}.mbr=${val}`. + +Rvalue Expansion +---------------- + +Implementation: + + # High level + array_get ${obj} mbr + val=${retval} + # Low level + eval 'val=${'__arr_${obj}_mbr'}' + +Syntax: + + val=${obj->mbr} + +Explanation: + +`->` dereferences/expands `obj` and accesses `mbr`, then `${...}` expands its +rvalue, as in the following (unsupported) syntax: `val=${${obj}.mbr}`. + +Rvalue Call +----------- + +Implementation: + + # High level + array_get ${obj} mbr + ${retval} + # Low level + eval "\${__arr_${obj}_mbr} ${obj}" 'arg' + +Syntax: + + ${obj->mbr} arg + +Explanation: + +`->` dereferences/expands `obj` and accesses `mbr`, then `${...}` expands its +rvalue, as in the following (unsupported) syntax: `${${obj}.mbr}`. + +Class Member Access Operations +============================== + +Lvalue Assignment +----------------- + +Implementation: + + # High level + array_set Cls mbr ${val} + # Low level + eval __arr_Cls_mbr'=${val}' + +Syntax: + + Cls::mbr=${val} + +Explanation: + +`::` accesses the `mbr` lvalue of `Cls`. + +Rvalue Expansion +---------------- + +Implementation: + + # High level + array_get ${Cls} mbr + val=${retval} + # Low level + eval 'val=${'__arr_Cls_mbr'}' + +Syntax: + + val=${Cls::mbr} + +Explanation: + +`::` accesses the `mbr` member of `Cls`, then `${...}` expands its rvalue. + +Rvalue Call +----------- + +Implementation: + + # High level + array_get ${Cls} mbr + ${retval} + # Low level + eval "\${__arr_Cls_mbr} Cls" 'arg' + +Syntax: + + ${Cls::mbr} + +Explanation: + +`::` accesses the `mbr` member of `Cls`, then `${...}` expands its rvalue. |