diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Class/Fields.pm | 33 | ||||
-rw-r--r-- | lib/ISA.pm | 20 |
2 files changed, 0 insertions, 53 deletions
diff --git a/lib/Class/Fields.pm b/lib/Class/Fields.pm deleted file mode 100644 index 4b23e7d731..0000000000 --- a/lib/Class/Fields.pm +++ /dev/null @@ -1,33 +0,0 @@ -package Class::Fields; -use Carp; - -sub import { - my $class = shift; - my ($package) = caller; - my $fields = \%{"$package\::FIELDS"}; - my $i = $fields->{__MAX__}; - foreach my $f (@_) { - if (defined($fields->{$f})) { - croak "Field name $f already used by a base class" - } - $fields->{$f} = ++$i; - } - $fields->{__MAX__} = $i; - push(@{"$package\::ISA"}, "Class::Fields"); -} - -sub new { - my $class = shift; - bless [\%{"$class\::FIELDS"}, @_], $class; -} - -sub ISA { - my ($class, $package) = @_; - my $from_fields = \%{"$class\::FIELDS"}; - my $to_fields = \%{"$package\::FIELDS"}; - return unless defined %$from_fields; - croak "Ambiguous inheritance for %FIELDS" if defined %$to_fields; - %$to_fields = %$from_fields; -} - -1; diff --git a/lib/ISA.pm b/lib/ISA.pm deleted file mode 100644 index d18242c13a..0000000000 --- a/lib/ISA.pm +++ /dev/null @@ -1,20 +0,0 @@ -package ISA; -use Carp; - -sub import { - my $class = shift; - my ($package) = caller; - foreach my $base (@_) { - croak qq(No such class "$base") unless defined %{"$base\::"}; - eval { - $base->ISA($package); - }; - if ($@ && $@ !~ /^Can't locate object method/) { - $@ =~ s/ at .*? line \d+\n$//; - croak $@; - } - } - push(@{"$package\::ISA"}, @_); -} - -1; |