+1
Le 12/1/15 21:21, Tudor Girba a écrit :
This is wonderful news, Marcus!
Thanks for the hard, tedious (and too often overlooked) work,
Doru
On Fri, Jan 9, 2015 at 8:15 PM, Marcus Denker <[email protected]
<mailto:[email protected]>> wrote:
Hi,
After some searching for a solution… that does not break
backward-compatibility, I found a way to save classes that use
slots.
- if a class just uses ivar Slots, it saves it 100% backward
compatible (e.g. loadable in other systems)
- if a class uses a special slot or class var, it saves the
definition of the slot as the variable name in the
monticello model.
- on load it checks if there is a space in a variable name, and if
yes —> decode these as Slot/Global var definions.
- the code path for non-Slot classes stays largely untouched.
This is not beautiful but backward compatible… you can even load
classes with Slots in Pharo3, it then creates invalid
ivar names, which of course means the code does not run but it is
readable.
e.g. create a class like
Object subclass: #A
slots: { #iv => TestSlot }
classVariables: { }
category: 'Playground’
(TestSlot is a slot that does not use up space in the instance and
instead saves the state in the Slot object, which
means all instances share the state. Just a small example)
Limitations
-> no support for class variables yet
-> class instance variables not yet done, either
-> nut used much, for sure there will be bugs
This is in 4.0 438
Marcus
--
www.tudorgirba.com <http://www.tudorgirba.com>
"Every thing has its own flow"