[Pharo-dev] Losing instance variable addition

Igor Stasenko siguctua at gmail.com
Thu Oct 31 18:37:01 EDT 2013

Btw, if you remember, i already proposed how to solve 'extending object's
state with arbitrary state' , mainly by changing the object format to
support variable number of key-value properties per object.
Similar to javascript or self, where you can define a new property on a
per-object basis.
This is fairly easy to implement, at VM level, just reserve extra field in
object format,
define the format of key/value dictionary and add primitives to retrieve
and store key-based properties for objects.
What i like in it, that at language side it is cost nothing: you don't have
to extend
the language to formally define the slots (but you may, of course),
and there's nothing preventing you from using private keys and not giving
them away
to anyone to keep your data private and not exposing it globally (except
from reflection tools i guess).
And, what is important, you are free to use them or not.. and it costs
almost nothing in terms of performance, and nothing in terms of formalism
and extra rules in language/package/source management etc etc

Best regards,
Igor Stasenko.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20131031/700488ae/attachment-0002.html>

More information about the Pharo-dev mailing list