I did not read the code in detail, but the behavior works beautifully now! Thanks! Doru On Fri, Jul 4, 2014 at 10:24 AM, Marcus Denker <marcus.denker@inria.fr> wrote:
On 03 Jul 2014, at 17:51, Marcus Denker <marcus.denker@inria.fr> wrote:
Hi,
If we have meta-object describing (and thus having the power to change the semantics of) instance variables, we need the same for Globals.
I think the easiest is to just re-use the object hat is already there: the âbindingâ, that is, the association from the dictionary where the global lives (e.g. the classPool for class vars, Smalltalk globals for true globals, and so on).
SystemVersion bindingOf: âCurrent'
The VM just cares that it is an assoiation (actually, it just care that there are two fields, but the rest of the image cares about value and keyâ¦)
-> we can make a subclass of Association -> we can have the compiler forward code generation to the object that describes the global -> we can add a nice MOP API: #read and #write: (instead of #value and #value:) -> Programmers can subclass the GlobalVariable and change #read and #write like they want (or override the code gen methods) as in Slots.
I have added a first GlobalVar hierarchy⦠it has already the code generation methods but Opal is not yet forwarding code generation (and the compiler does not yet compile bindings with the subclass).
Marcus
-- www.tudorgirba.com "Every thing has its own flow"