1

After using DynamicComposableModel and editing my method in debugger, my Pharo 6.1 image has reached this state:

Instance of SpecLayout did not understand #visibleSlots

and

Instance of SpecLayout did not understand #instVarNames

. I cannot "File Out" my code because of these errors. I cannot even browse my class, which is actually called "UIVidya" and should be defined by

ComposableModel subclass: #UIVidya
    instanceVariableNames: 'vidya listE editE tabmgr'
    classVariableNames: ''
    poolDictionaries: ''
    category: 'vkVidya'!

. In the broken image, UIVidya classLayout returns SpecLayout. In a healthy image, UIVidya classLayout returns FixedLayout. I did not make this change on purpose and do not even know how it happened. Can I heal my broken Pharo image in-place, without abandoning the last changes?

MKaama
  • 1,732
  • 2
  • 19
  • 28

2 Answers2

0

It doesn't look like your image is broken. The second error message suggests that you have an instance of SpecLayout where a class (presumably SpecLayout) is expected. Try defining the methods

instVarNames
  ^self class instVarNames

visibleSlots
  ^self class visibleSlots

on the instance side of SpecLayout to see if you can keep going and find the broken object. You can always come back here with more info. Once you have repaired the problem, don't forget to remove the new spurious methods.

Leandro Caniglia
  • 14,495
  • 4
  • 29
  • 51
  • Both these methods are implemented by AbstractLayout, but not by SpecLayout, not even in a fresh Pharo, so the problem is elsewhere. I suspect class layout is (practically) unrelated to Spec-layout which I was exercising, but the two got confused. – MKaama Aug 04 '18 at 10:44
  • I never thought these methods were necessary or part of the problem (in fact I referred to them as _spurious_). The idea of adding them was to give you more options for finding the broken object. The contribution of my answer, if any, was to call your attention in that it wasn't the image what was broken, but some instance pointing to an object that wasn't a class. Bottom line, I'm glad that you could recover your work and keep going. – Leandro Caniglia Aug 04 '18 at 15:20
0

I was able to restore normalcy by doing this in Playground:

UIVidya layout: sdfgh

(which is the same as UIVidya layout: nil). Thanks for your attention, what really helped was aggressive use of the System Browser and Playground to compare broken and non-broken Pharo instances. Now I can "File Out" my code!

EDIT:

The problem came from outdated tutorial at https://benjamin.vanryseghem.com/projects/spec/docs/dynamic/ which includes code that sends layout:. Don't do that in modern Pharo!

MKaama
  • 1,732
  • 2
  • 19
  • 28