[plt-scheme] The Inspector's Brother
At Sat, 24 Sep 2005 20:31:16 +0100, John Kozak wrote:
> I'm writing something a bit like a persistent object system.
> This has user-definable struct types, all of which are subtypes of an
> urstruct buried away in a module. I'd like the module to be able to
> walk the fields of all instances of the derived types, but don't
> particularly want them to be open to the world.
Do you know about the `define-serializable-struct' form from
`(lib "serialize.ss")'?
Maybe you can build what you need on that. If not, maybe you can
use the same ideas to implement your system.
The main idea is that information to construct and inspect struct
instances is attached to each struct through a property. The property
accessor is kept private.
I'll have to think more about `make-sibling-inspector'. Offhand, it
sounds like an ok idea, though I think a property is probably the
better route in this case.
Matthew