[plt-scheme] associating data with structure types

From: Neil W. Van Dyke (neil at neilvandyke.org)
Date: Fri Mar 19 15:00:53 EST 2004

I want to associate at least one piece of data with each subtype of a
particular structure type.  In this particular case, the data is
constant, and is known at the time the structure subtype is defined.

One way to do this would be with a hashtable keyed on the structure type
object.  But I'd prefer to encapsulate the data within the structure
type object itself, rather than maintain a homomorphic structure.

Is there a "user data" field in the structure type info (alongside the
constructor, predicate, etc. info) that could be used for this?  I
couldn't find reference to such a thing in the documentation.

Alternatively, for my current problem, an older MzScheme wishlist item
-- user-definable print and write methods for structure types -- would
work.

-- 
                                             http://www.neilvandyke.org/


Posted on the users mailing list.