Perl5cargo_cult
|
Perl5Base
/ \
Perl5PV Perl5IV
\ /
Perl5PVIV
The bottom 4 PMC classes shown are currently empty, so they genuinely are
just:
pmclass Perl5base extends Perl5cargo_cult dynpmc group Perl5_group {
}
pmclass Perl5PV extends Perl5base dynpmc group Perl5_group {
}
pmclass Perl5IV extends Perl5base dynpmc group Perl5_group {
}
pmclass Perl5PVIV extends Perl5PV extends Perl5IV dynpmc group Perl5_group {
}
When I try to compile them I see:
cc -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -I/home/nick/Ponie/ponie00/parrot/classes -I/home/nick/Ponie/ponie00/parrot/include -I/home/nick/Ponie/ponie00/perl -c -o perl5pviv.o perl5pviv.c
perl5pviv.c: In function `Parrot_Perl5PVIV_class_init':
perl5pviv.c:45: error: `Parrot_Perl5PV_init' undeclared (first use in this function)
perl5pviv.c:45: error: (Each undeclared identifier is reported only once
perl5pviv.c:45: error: for each function it appears in.)
perl5pviv.c:46: error: `Parrot_Perl5PV_init_pmc' undeclared (first use in this function)
perl5pviv.c:51: error: `Parrot_Perl5PV_destroy' undeclared (first use in this function)
perl5pviv.c:67: error: `Parrot_Perl5PV_get_integer_keyed_int' undeclared (first use in this function)
perl5pviv.c:85: error: `Parrot_Perl5PV_get_pointer' undeclared (first use in this function)
perl5pviv.c:87: error: `Parrot_Perl5PV_get_pointer_keyed_int' undeclared (first use in this function)
perl5pviv.c:92: error: `Parrot_Perl5PV_set_integer_keyed_int' undeclared (first use in this function)
perl5pviv.c:116: error: `Parrot_Perl5PV_set_pointer_keyed_int' undeclared (first use in this function)
This is because perl5pviv.c looks like this:
void
Parrot_Perl5PVIV_class_init(Parrot_Interp interp, int entry, int pass)
{
const struct _vtable temp_base_vtable = {
NULL, /* package */
-1, /* base_type */
NULL, /* whoami */
0, /* flags */
NULL, /* does_str */
NULL, /* isa_str */
NULL, /* class */
NULL, /* mro */
Parrot_Perl5PV_init,
Parrot_Perl5PV_init_pmc,
Why?
There are no Parrot_Perl5PV_init, etc functions. Is this a bug in pmc2c2.pl?
Nicholas Clark
Looks like a mistake I made. Too many autogenerated files.
Nicholas Clark
> Perl5cargo_cult
> |
> Perl5Base
> / \
> Perl5PV Perl5IV
> \ /
> Perl5PVIV
Nice.
> perl5pviv.c:45: error: `Parrot_Perl5PV_init' undeclared (first use in this function)
If memory serves me right there is a bug WRT totally empty classes. Put
at least an empty init() function inside.
A second point (dunno if it's still relevant): build the classes in
order of dependencies: base classes first. This is AFAIK achieved by
order in the Makefile, which goes to the build script.
> Nicholas Clark
leo