[racket] `immutable?` for `struct`s?

From: Greg Hendershott (greghendershott at gmail.com)
Date: Sat Jan 25 17:47:12 EST 2014

I'd mistakenly replied off-list, before re-posting here.

Carl you'd pointed out, off-list:

> I believe that's right.  I haven't ever done this or tested its accuracy, so
> you might want to double check that there aren't weird corner cases of the
> struct hierarchy, or at least that it works for the kinds of examples you
> have in mind.

Thanks for the caution. I did try some more cases and realized one
flaw: If an immutable struct is derived from a mutable one, my
predicate will (as written) incorrectly report it as immutable.
Instead I need to walk the chain of super-types, and check that all
are immutable. I'll work on this more...

Posted on the users mailing list.