Extending a Class by adding an Instance Variable

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Extending a Class by adding an Instance Variable

Sean P. DeNigris
Administrator
SmalltalkVimMode adds an instance variable to RubSmalltalkEditor so it can
track whether it is in normal/insert mode, etc. Currently, the inst var is
undeclared when the project is loaded and one has to manually edit the class
def to add it.

Is there an elegant way to handle this? I can't think of a way that isn't
awkward, dirtying packages, or leaving zombie objects around when editors
close...



-----
Cheers,
Sean
--
Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html

Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Extending a Class by adding an Instance Variable

ducasse
So far we do not have instance variable extensions.
Now what could be done is to have a dictionary of properties in RubSmalltalkEditor and like that method extensions could use
it.

We can integrate the extension.

> On 2 Feb 2020, at 05:21, Sean P. DeNigris <[hidden email]> wrote:
>
> SmalltalkVimMode adds an instance variable to RubSmalltalkEditor so it can
> track whether it is in normal/insert mode, etc. Currently, the inst var is
> undeclared when the project is loaded and one has to manually edit the class
> def to add it.
>
> Is there an elegant way to handle this? I can't think of a way that isn't
> awkward, dirtying packages, or leaving zombie objects around when editors
> close...
>
>
>
> -----
> Cheers,
> Sean
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
>