It would be nice if, rather than the various "pmcPerlHash" and
"pmcPerlArray" variants that exist, if there was a simple check to
see if the pmc in question did hash or did array - if so, then use
the default method for dumping hashes and arrays.
With a check first to see if the pmc/object that was passed
implemented a "dump" method.
This would allow generic HLL PMCs to automagically be dumped with
sane defaults.
>
> With a check first to see if the pmc/object that was passed
> implemented a "dump" method.
The opcode C<does> does exist, as well as interface names like 'hash'
or 'array'.
new P0, .Hash
does I0, P0, 'hash'
print I0
See also
perldoc build_tools/pmc2c.pl
/does
leo
Added in string, integer, and float does types to pmc2c.pl and the various core/perl types
that implement them.
Removed all the specific implementations that dispatched to a generic implementation, or
simply duplicated the functionality provided by "pmcDefault".
Avoid most upcoming deprecation warnings in these library routines.
Removed internal usage of Perl PMCs for these library routines.
All tests pass. (rechecked everything since I mucked with the basic PMC types to enable the
new 'does' variants.)
> [coke - Sat Jul 23 14:14:15 2005]:
>
> It would be nice if, rather than the various "pmcPerlHash" and
> "pmcPerlArray" variants that exist, if there was a simple check to
> see if the pmc in question did hash or did array - if so, then use
> the default method for dumping hashes and arrays.
>
> With a check first to see if the pmc/object that was passed
> implemented a "dump" method.
>