Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the PPI CPAN distribution.

Report information
The Basics
Id: 48218
Status: resolved
Priority: 0/
Queue: PPI

People
Owner: Nobody in particular
Requestors: user42 [...] zip.com.au
Cc:
AdminCc:

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



Subject: keep PPI::Structure::ForLoop for compatibility
Date: Mon, 27 Jul 2009 11:23:31 +1000
To: bug-PPI [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
In PPI 1.204_06 the renaming of PPI::Structure::ForLoop to PPI::Structure::For breaks perlcritic policies that were looking for the former, eg. in isa() or whatnot. The old name might not have been strictly accurate, but I believe in this case a change is much worse pain.
Subject: Re: [rt.cpan.org #48218] keep PPI::Structure::ForLoop for compatibility
Date: Mon, 27 Jul 2009 12:57:07 +1000
To: bug-PPI [...] rt.cpan.org
From: Adam Kennedy <adamkennedybackup [...] gmail.com>
I could put a temporary ->isa hack into ::For that will return true for ::ForLoop and warn, would that be enough? As for the core of Perl::Critic, we're going to do a simultaneous release anyway to make sure there's no clash. Adam K 2009/7/27 Kevin Ryde via RT <bug-PPI@rt.cpan.org>: Show quoted text
> Sun Jul 26 21:24:29 2009: Request 48218 was acted upon. > Transaction: Ticket created by user42@zip.com.au >       Queue: PPI >     Subject: keep PPI::Structure::ForLoop for compatibility >   Broken in: (no value) >    Severity: (no value) >       Owner: Nobody >  Requestors: user42@zip.com.au >      Status: new >  Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=48218 > > > > In PPI 1.204_06 the renaming of PPI::Structure::ForLoop to > PPI::Structure::For breaks perlcritic policies that were looking for the > former, eg. in isa() or whatnot. > > The old name might not have been strictly accurate, but I believe in > this case a change is much worse pain. > >
Subject: Re: [rt.cpan.org #48218] keep PPI::Structure::ForLoop for compatibility
Date: Mon, 27 Jul 2009 13:02:40 +1000
To: bug-PPI [...] rt.cpan.org
From: Adam Kennedy <adamkennedybackup [...] gmail.com>
I've had a look around and there are indeed a few cases where the change will break things, so I'll put the warning in. Adam K 2009/7/27 Kevin Ryde via RT <bug-PPI@rt.cpan.org>: Show quoted text
> Sun Jul 26 21:24:29 2009: Request 48218 was acted upon. > Transaction: Ticket created by user42@zip.com.au >       Queue: PPI >     Subject: keep PPI::Structure::ForLoop for compatibility >   Broken in: (no value) >    Severity: (no value) >       Owner: Nobody >  Requestors: user42@zip.com.au >      Status: new >  Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=48218 > > > > In PPI 1.204_06 the renaming of PPI::Structure::ForLoop to > PPI::Structure::For breaks perlcritic policies that were looking for the > former, eg. in isa() or whatnot. > > The old name might not have been strictly accurate, but I believe in > this case a change is much worse pain. > >
Subject: Re: [rt.cpan.org #48218] keep PPI::Structure::ForLoop for compatibility
Date: Thu, 30 Jul 2009 10:18:29 +1000
To: bug-PPI [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
"Reserved Local Account via RT" <bug-PPI@rt.cpan.org> writes: Show quoted text
> > I could put a temporary ->isa hack into ::For that will return true > for ::ForLoop and warn, would that be enough?
It'd help, but not with a warning please. Blasting users with warnings would be worse than some perlcritic false-positives. (Users of course can do little about warnings, it's authors using PPI who would have to be contacted, and even then of course they may be too overloaded to act immediately.) Is there actually a reason to change beyond the cosmetic? I'd encourage you to either not to do it, or to save it up and do it in the future with the next unavoidable compatibility-break. Batching up at least keeps down the number of occasions authors and users are asked to do work. Show quoted text
> simultaneous release
That's a bit unfortunate. Lock-step upgrades of multiple dists and their add-ons gets painful.
Subject: Re: [rt.cpan.org #48218] keep PPI::Structure::ForLoop for compatibility
Date: Thu, 30 Jul 2009 14:45:30 +1000
To: bug-PPI [...] rt.cpan.org
From: Adam Kennedy <adamkennedybackup [...] gmail.com>
2009/7/30 Kevin Ryde via RT <bug-PPI@rt.cpan.org>: Show quoted text
>       Queue: PPI >  Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=48218 > > > "Reserved Local Account via RT" <bug-PPI@rt.cpan.org> writes:
>> >> I could put a temporary ->isa hack into ::For that will return true >> for ::ForLoop and warn, would that be enough?
> > It'd help, but not with a warning please.  Blasting users with warnings > would be worse than some perlcritic false-positives. > > (Users of course can do little about warnings, it's authors using PPI > who would have to be contacted, and even then of course they may be too > overloaded to act immediately.)
Good point about the blasting. I'll make the warning so that it only fires once per process. Show quoted text
> Is there actually a reason to change beyond the cosmetic?  I'd encourage > you to either not to do it, or to save it up and do it in the future > with the next unavoidable compatibility-break.  Batching up at least > keeps down the number of occasions authors and users are asked to do > work.
Yes, there is a reason. The current implementation of for ( ... ) { ... } parsing treats all types of ( ... ) as a "For Loop". This is incorrect. That structure is going to be EITHER a legitimate PPI::Structure::For ( a braced three-statement triplet, ala C for loops ) or it's going to be a list of values. In the new release, the latter will change to show up as a PPI::Structure::List instead. This is a pretty serious change, so I felt the time was right to correct to split the old hybrid name into a different one. I'll look at keeping an altered version of ForLoop around to serve as a container for the dealing with the transition. Adam K Show quoted text
>> simultaneous release
> > That's a bit unfortunate.  Lock-step upgrades of multiple dists and > their add-ons gets painful. > >
Subject: Re: [rt.cpan.org #48218] keep PPI::Structure::ForLoop for compatibility
Date: Sun, 02 Aug 2009 08:34:58 +1000
To: bug-PPI [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
"Reserved Local Account via RT" <bug-PPI@rt.cpan.org> writes: Show quoted text
> > I'll look at keeping an altered version of ForLoop around to serve as > a container for the dealing with the transition.
So For will be a subclass of ForLoop, making that finer distinction of a C-style triplet? That sounds fully compatible with any generating/parsing that's been using ForLoop.
Subject: Re: [rt.cpan.org #48218] keep PPI::Structure::ForLoop for compatibility
Date: Mon, 3 Aug 2009 10:41:23 +1000
To: bug-PPI [...] rt.cpan.org
From: Adam Kennedy <adamkennedybackup [...] gmail.com>
No. But both ::For and ::List will return true to ->isa(::ForLoop) if they are part of a for compound statement. Adam K 2009/8/2 Kevin Ryde via RT <bug-PPI@rt.cpan.org> Show quoted text
> Queue: PPI > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=48218 > > > "Reserved Local Account via RT" <bug-PPI@rt.cpan.org> writes:
> > > > I'll look at keeping an altered version of ForLoop around to serve as > > a container for the dealing with the transition.
> > So For will be a subclass of ForLoop, making that finer distinction of a > C-style triplet? That sounds fully compatible with any > generating/parsing that's been using ForLoop. > >
Subject: Re: [rt.cpan.org #48218] keep PPI::Structure::ForLoop for compatibility
Date: Thu, 06 Aug 2009 08:53:46 +1000
To: bug-PPI [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
"Reserved Local Account via RT" <bug-PPI@rt.cpan.org> writes: Show quoted text
> > But both ::For and ::List will return true to ->isa(::ForLoop) if they are > part of a for compound statement.
Don't give a warning in that case, since otherwise it's not possible to write code that works in both 1.204 and 1.205 without provoking a warning from the latter. Simply asking isa('anything') should quietly say yes or no.
Subject: Re: [rt.cpan.org #48218] keep PPI::Structure::ForLoop for compatibility
Date: Thu, 6 Aug 2009 11:38:04 +1000
To: bug-PPI [...] rt.cpan.org
From: Adam Kennedy <adamkennedybackup [...] gmail.com>
The expected behaviour of someone that wants to support both is to provide two alternative search functions, and switch based on $PPI::VERSION > 1.205. NOTABUG Adam K 2009/8/6 Kevin Ryde via RT <bug-PPI@rt.cpan.org> Show quoted text
> Queue: PPI > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=48218 > > > "Reserved Local Account via RT" <bug-PPI@rt.cpan.org> writes:
> > > > But both ::For and ::List will return true to ->isa(::ForLoop) if they
> are
> > part of a for compound statement.
> > Don't give a warning in that case, since otherwise it's not possible to > write code that works in both 1.204 and 1.205 without provoking a > warning from the latter. Simply asking isa('anything') should quietly > say yes or no. > >