logo       

Re: Re: monticello package - adding instance variables toexisting classes: msg#00095

lang.smalltalk.squeak.beginners

Subject: Re: Re: monticello package - adding instance variables toexisting classes


>>
>> For the most part, this is the reason for the restriction. I
>> would consider it a bug.
> <snipped>
>
> For plain MC you can hack around it with the meta sword, as usual.
>
> - Bert -
Yes indeed a missing feature.

MC1.5 has hooks for it, you define a methods prefixed #mcInstall /
#mcUninstall #mcAfterInstall / #mcAfterRemoval

e.g.

SomeoneElsesClass-mcOnInstallAddVarNewVarName: aClassEditor {
*mypackagecategory }

"This code gets run on installing the package before the new package is
committed to the image.
In the method you are passed the class to which you can make any changes
you wish. e.g."

aClassEditor addInstVarName: 'bob'

....

Unfortunately however these hooks were designed to be used with the new
SystemEditor based atomic loading scheme, and does not work out of the
box with the current release.

However you have just inspired me fix that so.. use at your own risk.

MC1.5 with these hooks enabled is in http://mc.squeaksource.com/mc

best regards

Keith


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise