Skip Menu |

This queue is for tickets about the namespace-autoclean CPAN distribution.

Report information
The Basics
Id: 50938
Status: resolved
Priority: 0/
Queue: namespace-autoclean

People
Owner: ether [...] cpan.org
Requestors: rsrchboy [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.09
Fixed in: 0.16-TRIAL



Subject: namespace::autoclean removes overloads
namespace::autoclean is pretty nifty. However, when it removes all CODE symbols not known as methods, it also takes out any operator overloads installed. Given that there's currently no Moosey way to handle this (correction welcome), here's a simple patch to filter overloads (and adds tests): http://github.com/RsrchBoy/namespace-autoclean/commit/344ef42fc3020a5c4b539718fbf1436300f325dd
This is a horrible hack, we should extends CMOP correctly to provide an extension to overloading (this is mostly all implemented in MX::Role::WithOverloading already).. I'm going to reject this as I don't think this patch is sane/acceptable.
Subject: Re: [rt.cpan.org #50938] namespace::autoclean removes overloads
Date: Sat, 8 May 2010 17:28:27 -0700
To: bug-namespace-autoclean [...] rt.cpan.org
From: Chris Weyl <rsrchboy [...] cpan.org>
On Sat, May 8, 2010 at 2:51 PM, Tomas Doran via RT <bug-namespace-autoclean@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=50938 > > > This is a horrible hack, we should extends CMOP correctly to provide an > extension to overloading (this is mostly all implemented in > MX::Role::WithOverloading already)..
No problem -- I rather figured that was going to be the case :) Can you point me at the right direction in CMOP's guts? I'm happy to take a stab at doing it the right way. -Chris -- Chris Weyl Ex astris, scientia
Le Sam 08 Mai 2010 17:51:57, BOBTFISH a écrit : Show quoted text
> This is a horrible hack, we should extends CMOP correctly to provide
an Show quoted text
> extension to overloading (this is mostly all implemented in > MX::Role::WithOverloading already).. > > I'm going to reject this as I don't think this patch is
sane/acceptable. Well, the hack doesn't seem so horrible to me ... one could argue that the hidden method names generated by overload are even more horrible ! Anyway, meanwhile the problem remains, and this is really annoying, so if you don't like the patch, please do something to find another solution. I just got stuck with the same problem in DBIx::DataModel (which uses namespace::autoclean, overload, but no Moose).
Subject: Re: [rt.cpan.org #50938] namespace::autoclean removes overloads
Date: Thu, 13 Oct 2011 10:35:54 -0700
To: Laurent Dami via RT <bug-namespace-autoclean [...] rt.cpan.org>
From: Karen Etheridge <ether [...] cpan.org>
On Wed, Oct 12, 2011 at 11:28:38AM -0400, Laurent Dami via RT wrote: Show quoted text
> Anyway, meanwhile the problem remains, and this is really annoying, so > if you don't like the patch, please do something to find another > solution. > > I just got stuck with the same problem in DBIx::DataModel (which uses > namespace::autoclean, overload, but no Moose).
I've encountered similar issues when memoizing methods in a Moose class. This is the wrapper I wrote for it (i.e. add the new methods in the MOP)... sub memoize_with_normalizer($$) { my ($full_method_name, $normalizer) = @_; my $sub = memoize($full_method_name, NORMALIZER => $normalizer); # install the memoized sub into the correct class, so Test::CleanNamespaces # doesn't complain about this as an uncleaned import. my ($package, $method_name) = ($full_method_name =~ /^(.*)::([^:]+)$/); my $mutable = $package->meta->is_immutable; $package->meta->make_mutable if $mutable; $package->meta->add_method($method_name => $sub); $package->meta->make_immutable if $mutable; } I think it would probably be sane to add some interfaces to add overloads that added the methods to the MOP.
Subject: Re: [rt.cpan.org #50938] namespace::autoclean removes overloads
Date: Thu, 13 Oct 2011 11:03:03 -0700
To: bug-namespace-autoclean [...] rt.cpan.org
From: Chris Weyl <rsrchboy [...] cpan.org>
On Thu, Oct 13, 2011 at 10:36 AM, Karen Etheridge via RT < bug-namespace-autoclean@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=50938 > > e problem in DBIx::DataModel (which uses
> > namespace::autoclean, overload, but no Moose).
> > I've encountered similar issues when memoizing methods in a Moose class. > This is the wrapper I wrote for it (i.e. add the new methods in the MOP)... >
Check out MooseX::MarkAsMethods :) -- Chris Weyl Ex astris, scientia
The 0.16 trial release should fix this.
Fixed in 0.16-TRIAL and 0.17 (stable).