Revision history for Perl extension Class::C3.
+0.13 Not Yet Released XXXX
+ - Make use of Algorithm::C3 0.05's merge caching
+
0.12 Tues. July 18, 2006
- clarifying docs for &initialize (thanks jcs)
- applying patch from Robert Norris to add
0.01 - Sun, Aug 7, 2005
- initial release of module
- - some code and tests based on previous Perl6::MetaModel work
\ No newline at end of file
+ - some code and tests based on previous Perl6::MetaModel work
'Test::More' => 0.47,
'Test::Exception' => 0.15,
'Scalar::Util' => 1.10,
- 'Algorithm::C3' => 0.01,
+ 'Algorithm::C3' => 0.05,
}
);
use Scalar::Util 'blessed';
use Algorithm::C3;
-our $VERSION = '0.12';
+our $VERSION = '0.13';
# this is our global stash of both
# MRO's and method dispatch tables
## functions for applying C3 to classes
sub _calculate_method_dispatch_tables {
+ my %merge_cache;
foreach my $class (keys %MRO) {
- _calculate_method_dispatch_table($class);
+ _calculate_method_dispatch_table($class, \%merge_cache);
}
}
sub _calculate_method_dispatch_table {
- my $class = shift;
+ my ($class, $merge_cache) = @_;
no strict 'refs';
- my @MRO = calculateMRO($class);
+ my @MRO = calculateMRO($class, $merge_cache);
$MRO{$class} = { MRO => \@MRO };
my $has_overload_fallback = 0;
my %methods;
## functions for calculating C3 MRO
sub calculateMRO {
- my ($class) = @_;
+ my ($class, $merge_cache) = @_;
return Algorithm::C3::merge($class, sub {
no strict 'refs';
@{$_[0] . '::ISA'};
- });
+ }, $merge_cache);
}
package # hide me from PAUSE
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
-=cut
\ No newline at end of file
+=cut