Revision history for Perl extension Class::C3.
+0.06 -
+ - added Sub::Name to dependencies (even though it is
+ just for the tests)
+ - removed OS X resource fork which slipped into the tar.gz
+ - improved error reporting for Inconsistent Hierarchies
+
0.05 - Mon, Nov 14, 2005
- added caching to next::method, courtesy of quicksilver
and mst over at #dbi-class
use ExtUtils::MakeMaker;
-# See lib/ExtUtils/MakeMaker.pm for details of how to influence
-# the contents of the Makefile that is written.
WriteMakefile(
'NAME' => 'Class::C3',
'VERSION_FROM' => 'lib/Class/C3.pm', # finds $VERSION
'PREREQ_PM' => {
'Test::More' => 0.47,
'Test::Exception' => 0.15,
- 'Scalar::Util' => 1.10
+ 'Scalar::Util' => 1.10,
+ 'Sub::Name' => 0
}
);
use Scalar::Util 'blessed';
-our $VERSION = '0.05';
+our $VERSION = '0.06';
# this is our global stash of both
# MRO's and method dispatch tables
# http://www.python.org/2.3/mro.html
sub _merge {
my (@seqs) = @_;
+ my $class_being_merged = $seqs[0]->[0];
my @res;
while (1) {
# remove all empty seqences
my @nonemptyseqs = (map { (@{$_} ? $_ : ()) } @seqs);
# return the list if we have no more no-empty sequences
return @res if not @nonemptyseqs;
+ my $reject;
my $cand; # a canidate ..
foreach my $seq (@nonemptyseqs) {
$cand = $seq->[0]; # get the head of the list
$nothead++ && last if exists $in_tail{$cand};
}
last unless $nothead; # leave the loop with our canidate ...
+ $reject = $cand;
$cand = undef; # otherwise, reject it ...
}
- die "Inconsistent hierarchy" if not $cand;
+ die "Inconsistent hierarchy found while merging '$class_being_merged':\n\t" .
+ "current merge results [\n\t\t" . (join ",\n\t\t" => @res) . "\n\t]\n\t" .
+ "mergeing failed on '$reject'\n" if not $cand;
push @res => $cand;
# now loop through our non-empties and pop
# off the head if it matches our canidate