Having trouble making a simple recursive inspector.

Charles L. Perkins clp at parian.bos.marble.com
Mon Oct 15 18:59:20 UTC 1990

I tried to create a simple recursive inspector just to see if I could.

After a little fiddling I came up with:

_AddSlots: (| irec: = (| :obj m. | m: obj _Mirror. inspect: obj.
	m _MirrorSize do:
		[|:n| irec: (m _MirrorContentsAt: n) _MirrorReflectee].)|)

Which is called, e.g., via "irec: <an object>" like the normal inspect:

Now I know that even is this did run, it would probably run forever due to
 loops in the system structure, but I want to watch it run through the parent
 pointer, etc.

It seems to work just fine except that methods won't respond to _MirrorReflectee
 for some reason (Grrrr!!).  This seems like a needless non-generality!  Am I
 missing something?  Why can't methods allow this?  Is there an equally simple
 (or any easy) way to do what I want?

More information about the Self-interest mailing list