))
);
-# NOTE:
-# use the metaclass to construct the meta-package
-# which is a superclass of the metaclass itself :P
-Class::MOP::Package->meta->add_method('initialize' => sub {
- my $class = shift;
- my $package_name = shift;
- $class->meta->new_object('package' => $package_name, @_);
-});
-
## --------------------------------------------------------
## Class::MOP::Module
my $package_name = shift;
# we hand-construct the class
# until we can bootstrap it
- no strict 'refs';
- return bless {
+ $class->_new(
'package' => $package_name,
+ );
+}
+
+sub _new {
+ my ( $class, @args ) = @_;
+
+ bless {
# NOTE:
# because of issues with the Perl API
# to the typeglob in some versions, we
# Ideally we could just store a ref and
# it would Just Work, but oh well :\
'namespace' => \undef,
- } => $class;
+ @args,
+ }, $class;
}
# Attributes