Ticket #561 (closed todo: fixed)

Opened 13 years ago

Last modified 11 years ago

What are valid characteristics for 'inspect_str' vtable?

Reported by: coke Owned by:
Priority: normal Milestone:
Component: core Version:
Severity: medium Keywords: docs vtable
Cc: Language:
Patch status: Platform:

Description

From PDD17:

=item inspect

  PMC* inspect(INTERP, PMC *self)

Return a hash of all characteristics of the I<self> PMC available for
introspection.

  PMC* inspect_str(INTERP, PMC *self, STRING *what)

Return a PMC value for one characteristic of the I<self> PMC, selected
by string name. Returns PMCNULL if the characteristic doesn't exist.

We need to document which strings are potentially valid for 'what'.

This was originally logged as RT#47974

Change History

Changed 13 years ago by allison

Any strings are potentially valid for 'what'. Just like a PMC can have any attributes it needs, a PMC can allow introspection into any aspects of its internals.

It's worth deciding if there is a minimum subset of introspection that we want all PMCs to support, and add it to the default PMC. At the moment that's 'flags' (the PMC's integer flags), and 'mro'. Another good one could be 'attributes'. PMCs that use ATTR declarations could generate a function or macro that builds a data structure with attribute information. Likely also 'methods' and 'parents', using similar strategies to make that low-level information easily accessible from the runtime environment.

Allison

Changed 13 years ago by whiteknight

  • status changed from new to closed
  • resolution set to fixed

Given what Allison said above, is this ticket still necessary? All strings are valid to inspect_str, so that answers the question that this ticket originally posed. I am closing this one. We can maybe open a different ticket to cover things like a minimum introspection interface, or automatically-generated introspection functions.

Changed 13 years ago by coke

  • status changed from closed to reopened
  • resolution fixed deleted

In lieu of another ticket to track that issue, re-opening this ticket. If someone opens a new ticket, please refer to it here before closing this one.

Changed 13 years ago by jkeenan

  • component changed from none to core

Changed 11 years ago by jkeenan

coke, whiteknight:

There has been no discussion in this ticket for two years. Is there any reason why we should keep it open? If so, please describe what is currently wrong, why it is wrong and what we need to do to fix the problem.

Thank you very much.

kid51

Changed 11 years ago by cotto

  • status changed from reopened to closed
  • resolution set to fixed

I'm closing this ticket since allison made it clear that any string is valid. Discussion of a minimal set of valid values for 'what' is fine, but beyond the scope of this ticket.

Note: See TracTickets for help on using tickets.