Skip Menu |

This queue is for tickets about the syntax CPAN distribution.

Report information
The Basics
Id: 77253
Status: resolved
Priority: 0/
Queue: syntax

People
Owner: Nobody in particular
Requestors: IKEGAMI [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: no syntax qw( module );
Hi, It was suggested that I move some of my modules to Syntax::Feature::. My modules currently support C<< no module; >>, but L<syntax> does not forward C<unimport> to modules in the same way as it forwards C<import>. Would you be amiable to adding this feature? I can create a patch for you. The core of it would be: return if !$package->can('uninstall'); return $package->uninstall( from => $caller, options => $options, identifier => $feature, outer => $all_params, ); Thanks, Eric
Subject: Re: [rt.cpan.org #77253] no syntax qw( module );
Date: Fri, 18 May 2012 17:05:47 +0200
To: bug-syntax [...] rt.cpan.org
From: Robert Sedlacek <rs [...] 474.at>
Hi Eric, First, sorry it took me a couple days to reply. On Wed, 2012-05-16 at 20:41 -0400, ikegami via RT wrote: Show quoted text
> It was suggested that I move some of my modules to Syntax::Feature::. > > My modules currently support C<< no module; >>, but L<syntax> does not > forward C<unimport> to modules in the same way as it forwards C<import>. > > Would you be amiable to adding this feature? I can create a patch for > you. The core of it would be: > > return if !$package->can('uninstall'); > return $package->uninstall( > from => $caller, > options => $options, > identifier => $feature, > outer => $all_params, > );
I've added a first draft of the feature to the repository at https://github.com/phaylon/syntax It currently warns if you try to `no syntax 'foo'` when 'foo' doesn't provide an uninstall method. I thought simply not doing anything might be surprising. But I'm not too fixated on that if you have a need for it to be a NOOP. If this does what you require, I'd be happy to push a release. HTH, Robert
CC: IKEGAMI [...] cpan.org
Subject: Re: [rt.cpan.org #77253] no syntax qw( module );
Date: Fri, 18 May 2012 12:12:51 -0400
To: bug-syntax [...] rt.cpan.org
From: Eric Brine <ikegami [...] adaelis.com>
On Fri, May 18, 2012 at 11:06 AM, Robert 'phaylon' Sedlacek via RT < bug-syntax@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=77253 > > I thought simply not doing anything might > be surprising. But I'm not too fixated on that
if you have a need for it to be a NOOP. Show quoted text
>
I simply did it that way because that's how modules without unimport behave. $ perl -e'no CGI;' $ perl -e'no DBI;' $ perl -e'BEGIN { $INC{"Foo.pm"} = 1; } no Foo;' $ That said, I see no harm in issuing a warning or even croaking. If this does what you require, I'd be happy to push a release. Show quoted text
>
Looks good, except $package->uninstall( into => ... ) doesn't make that much sense, grammatically speaking. Perhaps the following would be better? $package->uninstall( from => ... ) Thanks! - Eric
CC: IKEGAMI [...] cpan.org
Subject: Re: [rt.cpan.org #77253] no syntax qw( module );
Date: Fri, 18 May 2012 13:33:49 -0400
To: bug-syntax [...] rt.cpan.org
From: Eric Brine <ikegami [...] adaelis.com>
On Fri, May 18, 2012 at 12:13 PM, ikegami@adaelis.com via RT < bug-syntax@rt.cpan.org> wrote: Show quoted text
> Looks good, except > > $package->uninstall( into => ... ) > > doesn't make that much sense, grammatically speaking. Perhaps the following > would be better? > > $package->uninstall( from => ... ) >
Patch provided: https://github.com/phaylon/syntax/pull/1
Subject: Re: [rt.cpan.org #77253] no syntax qw( module );
Date: Fri, 18 May 2012 20:51:06 +0200
To: bug-syntax [...] rt.cpan.org
From: Robert Sedlacek <rs [...] 474.at>
On Fri, 2012-05-18 at 13:34 -0400, ikegami@adaelis.com via RT wrote: Show quoted text
> > Looks good, except > > > > $package->uninstall( into => ... ) > > > > doesn't make that much sense, grammatically speaking. Perhaps the following > > would be better? > > > > $package->uninstall( from => ... ) > >
> > Patch provided: > https://github.com/phaylon/syntax/pull/1
Yea, the consistency-keeping side of my brain won over the English speaking one there. Pulled and released: https://metacpan.org/release/PHAYLON/syntax-0.004 Thanks! Robert