[plt-scheme] structure inspectors

From: Mike T. Machenry (dskippy at ccs.neu.edu)
Date: Fri Jun 27 10:24:16 EDT 2003

I am having a problem testing programs that return structs. Currently I am
creating a test-suite helper function for every struct that I define in the
program that compares two values of that struct. This gets tiresome. equal?
does not work without an inspector.

I tried writing a more powerful equal? for my test macro that would use
struct->vector when struct? was true. Sadly struct? does not work without 
an inspector. I then tried just changing all my structure definitions to have
inspectors which was pretty nice, but I needed to change my code inorder to
test it.

How do others solve this problem?
What is the reasoning for having structs be an opaque, incomprable thing by


Posted on the users mailing list.