From: Shawn M Moore Date: Tue, 5 Aug 2008 03:50:26 +0000 (+0000) Subject: Hide remove_keywords a bit, rename it to _remove_keywords. Warn about it maybe being... X-Git-Tag: 0_55_01~55 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1b9f0d4cb4c3dcd2ccf683b649644e381cb234a5;p=gitmo%2FMoose.git Hide remove_keywords a bit, rename it to _remove_keywords. Warn about it maybe being deprecated. Sub::Exporter anyone? :) --- diff --git a/Changes b/Changes index d28929a..fcc31c0 100644 --- a/Changes +++ b/Changes @@ -3,7 +3,7 @@ Revision history for Perl extension Moose 0.56 * Moose * Moose::Cookbook::Extending::Recipe2 - - Add a remove_keywords function so if you extend Moose + - Add a _remove_keywords function so if you extend Moose you don't have to cargo cult Moose's unimport (Sartak) * Moose diff --git a/lib/Moose.pm b/lib/Moose.pm index 21ef374..a421c74 100644 --- a/lib/Moose.pm +++ b/lib/Moose.pm @@ -195,7 +195,7 @@ use Moose::Util (); sub unimport { my $class = _get_caller(@_); - remove_keywords( + _remove_keywords( source => __PACKAGE__, package => $class, keywords => [ keys %exports ], @@ -204,7 +204,7 @@ use Moose::Util (); } -sub remove_keywords { +sub _remove_keywords { my ( %args ) = @_; my $source = $args{source}; @@ -835,19 +835,6 @@ and optionally a baseclass and a metaclass as arguments. For more detail on this topic, see L. -=head2 B - -The remove_keywords method is called by Moose's C to remove Moose's -keywords from a package when C is used. If you extend Moose with -new keywords, you should provide an C that calls C -to remove your sugar. - -C takes named parameters C (to make sure that we -don't remove keywords defined by somebody else), C (from which we're -removing keywords), and C (an array reference of keyword names). - -For more detail on this topic, see L. - =head1 CAVEATS =over 4 diff --git a/lib/Moose/Cookbook/Extending/Recipe2.pod b/lib/Moose/Cookbook/Extending/Recipe2.pod index e0ad543..eeec31e 100644 --- a/lib/Moose/Cookbook/Extending/Recipe2.pod +++ b/lib/Moose/Cookbook/Extending/Recipe2.pod @@ -37,7 +37,7 @@ Moose::Cookbook::Extending::Recipe2 - Acting like Moose.pm and providing sugar M sub unimport { my $caller = caller(); - Moose::remove_keywords( + Moose::_remove_keywords( source => __PACKAGE__, package => $caller, keywords => \@EXPORT, @@ -123,11 +123,12 @@ This is all a bit fragile since it doesn't stack terribly well. You can basically only have one Moose-alike module. This may be fixed in the still-notional C module someday. -The C subroutine calls the C function +The C subroutine calls the C<_remove_keywords> function from Moose. This function removes only the keywords exported by -this module. More precisely, C removes from the +this module. More precisely, C<_remove_keywords> removes from the C package the keywords given by the C argument -that were created in the C package. +that were created in the C package. This functionality may +be deprecated if L begins providing it. Finally, we have our C subroutine. This provides a bit of sugar that looks a lot like C.