On 1/20/2021 1:53 AM, Sorawee Porncharoenwase wrote:
However, ‘struct-field-info-list’ returns only fields defined by the
actual type and does not include fields that were inherited. What I
don’t see is any simple way to get at the struct’s inheritance
hierarchy
—- it seems that you have to iterate ‘struct-type-info’ to
enumerate the
supertypes.
Yes, that’s a (the?) way to extract field names of supertypes. The
reason I designed it in that way is that field name is a concept for
each level in the hierarchy, not across levels. You can’t have two
identical field names in a level, but you can have identical field
names across levels. So lumping field names across levels together
doesn’t look like a good idea to me.
Yes, but fields defined in an ancestor are visible in its descendants.
I understand the need to distinguish the individual types, but
'struct-type-info' does that already. IMO there should be an easy way
to get information on *all* the fields at once - potentially including
which supertype(s) defined them.
YMMV,
George
--
You received this message because you are subscribed to the Google Groups "Racket
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/racket-users/ba71e843-a3ae-d2ad-646d-27951b700485%40comcast.net.