So after discussion the solution would be: - ClassBinding for instance side method literals and globals dictionary (instead of GlobalVariable) - MetaclassBinding for the last literal of class side methods. It will include proper comment about where it is used and how, with description of current trick 2017-09-13 16:45 GMT+02:00 Marcus Denker <marcus.denker@inria.fr>:
On 12 Sep 2017, at 17:33, Guillermo Polito <guillermopolito@gmail.com> wrote:
I don't know... I found the idea of having a Metaclass binding strange...
I mean, - metaclasses are not stored in any name dictionary such as Smalltalk - nobody references them directly in source code but by their direct classes
The metaclass binding is there just for one thing really: methods need an association to know their class in case they have to do a super send. And transitively this is a compiler problem also. But anybody else accesses metaclasses' bindings. â yes, we need it just for the last literal.
We added the âif there is a method, get the binding from thereâ we adde as else we would compiler every class side method with a new Association instance, which wastes lots of space.
Marcus