Racket seems to have two mechanisms for adding per-type information to structs: generics
and properties
. Unfortunately, the documentation doesn't seem to indicate when one is preferred over the other. The docs do say:
Generic Interfaces provide a high-level API on top of structure type properties.
But that doesn't seem to provide a good intuition when I should use one over the other. It does seem pretty clear that define-generic
provides a much higher level interface than make-struct-type-property
. But many struct types still only use properties, which seems to indicate that there are still cases where the low-level API is preferred.
So the question is, when is using the struct properties system better than using the generics one, or does the properties library only exist as a historic relic?