Leopold Toetsch <[EMAIL PROTECTED]> writes:

> Tracing through Parrot programs shows the type and value of
> variables. This doesn't work very well for PMCs, trace_pmc_dump()
> tries to extract some info from the PMC, but much better would it be,
> if the PMC itself can return a string representation of itself.

ACK, wanted something like this forever.

> STRING* dump(INTERP, SELF, STRING *, INTVAL flags);

what is the STRING * parameter good for. I assume lineheaders.

> append and return a printable representation of SELF, with flags being:
> 0x1 ... name (whoami)
> 0x2 ... id (enum)
> 0x4 ... value(s) (non aggregates)
> 0x8 ... address
> ...     e.g. newlines, tabs in output for aggregates
> 0x100...n ... dump of aggregate items at nesting (n-0x100)

Use the lower bits for nesting depth. This way you can use 
n = flags & 0xff to obtain the nesting depth, and still define 
the flags which can be passed to the passed to dump of the childs:
dump (..., (flags & ~0xff) | n-1);

> Comments welcome 
> leo

allways
boe
-- 
Juergen Boemmels                        [EMAIL PROTECTED]
Fachbereich Physik                      Tel: ++49-(0)631-205-2817
Universitaet Kaiserslautern             Fax: ++49-(0)631-205-3906
PGP Key fingerprint = 9F 56 54 3D 45 C1 32 6F  23 F6 C7 2F 85 93 DD 47

Reply via email to