Jan. 9, 2019
10:07 a.m.
Hi Steffen,
However, there is another fun possibility to figure out that a change happened that does not involve configuration - though, a bit hacky. ;-) You could write the accessor method such that it recompiles itself with the first access after loading new code. For example:
Singleton>>uniqueInstance instance := self class new. self class compile: 'uniqueInstance ^instance'. ^instance
If I understand this correctly, it replaces the uniqueInstance method by another one that returns the singleton instance. And when the code is reloaded, it's the above method that is reinstated, to be used just once. Neat! Thanks, Konrad.