Hi,
basis for annotating instanceVariables (Slots) with meta links is now working. https://pharo.fogbugz.com/f/cases/16669/MetaLinks-on-Slots This test is green: testReifySlotName | iVar instance link | iVar := ReflectivityExamples slotNamed: #ivar. link := MetaLink new metaObject: self; selector: #tagExec:; arguments: #(name). iVar link: link. self assert: iVar hasMetalink. self assert: (ReflectivityExamples >> #exampleIvarRead) class = ReflectiveMethod. self assert: (tag isNil). instance := ReflectivityExamples new. self assert: (instance exampleIvarRead = 33). self assert: (tag = #ivar). link uninstall. |
Yuppee! This means that we can now implement an inspector refresh properly, right? Cheers, Doru On Wed, Sep 30, 2015 at 11:49 AM, Marcus Denker <[hidden email]> wrote: Hi, |
The only problem is that the change is only active for new method invocations… so there might be cases where it would not update if the change is done in a loop, for example, and active on the stack already…
|
Hi, I think this should be Ok for most inspector cases because we rarely open the object in the middle of a method and expect it to be updated within that same method. Or did I get it wrong? Cheers, Doru On Wed, Sep 30, 2015 at 5:31 PM, Marcus Denker <[hidden email]> wrote:
|
> On 30 Sep 2015, at 17:45, Tudor Girba <[hidden email]> wrote: > > Hi, > > I think this should be Ok for most inspector cases because we rarely open the object in the middle of a method and expect it to be updated within that same method. Or did I get it wrong? > if you want to do change tracking by interception all writes, than any update in a loop (that accesses the ivar directly) that is active already before the inspector is opened would be not seen. I do not think this happens often. Possible solutions: - detect this case “there is method on the stack accessing this ivar —> do slow update, or display a warning that automatic update might not work) - Implement on-stack replacement for e.g. just #before links… - use another mechanism to detect state change Marcus |
Free forum by Nabble | Edit this page |