requires: {#Stack. #WriteStream}. provides: {#Inspector}. "This inspector library is completely designed assuming that the standard libraries are loaded and mostly working." prototypes addPrototype: #Inspector derivedFrom: {Cloneable}. "This is a very basic object navigator, for playing around and ease of use at the command line." Inspector addSlot: #it valued: lobby. "The last object inspected into; the current context." Inspector addSlot: #history valued: ({lobby} as: Stack). "The previous objects inspected into; the series of contexts followed." i@(Inspector traits) newOn: obj [| newI | newI: i clone. newI history: ({obj} as: newI history). newI it: obj. newI ]. _@lobby inspect: obj [ lobby addDelegate: #inspector valued: (Inspector newOn: obj) ]. i@(Inspector traits) here "Here is where #it's at." [i it]. i@(Inspector traits) last [i history top]. i@(Inspector traits) slots [i it slotNames]. i@(Inspector traits) map [| s | s: '' writer. (i it is: Sequence) ifFalse: [^ Nil]. s nextPut: ${. i it doWithIndex: [| :each :index | index printOn: s. s ; ': '. each printOn: s. s ; '.\n']. s nextPut: $}. s contents ]. i@(Inspector traits) parents [i it delegateNames]. i@(Inspector traits) go: slotName [| next | next: (i it atSlotNamed: slotName). next ifNil: [^ 'Nil: nothing done.']. i history push: i it. i it: next. i it ]. i@(Inspector traits) back "Moves the last context off the history Stack and makes it it." [ i it: i history pop ]. i@(Inspector traits) back: n "Moves the last n contexts off the history Stack and makes the last one it." [ n timesRepeat: [i it: i history pop] ]. i@(Inspector traits) backToStart "Clears the history stack and returns the inspector to the original object inspected." [ i it: i history bottom. i history clear. i history push: i it ]. i@(Inspector traits) close "Sever all the connections that make the Inspector work, for memory safety, and return the Inspector." [ i it: Nil. i history: Nil. lobby removeSlot: #inspector. i ]. Console ; 'You are in a twisty little maze of objects, all alike.'.