develooper Front page | perl.perl5.porters | Postings from January 2012

Re: How we deprecate (was Re: Deprecating '\w {' in v5.16)

Thread Previous | Thread Next
Nicholas Clark
January 31, 2012 07:44
Re: How we deprecate (was Re: Deprecating '\w {' in v5.16)
Message ID:
On Tue, Jan 31, 2012 at 04:40:37PM +0100, demerphq wrote:
> On 31 January 2012 16:19, Nicholas Clark <> wrote:
> > On Tue, Jan 31, 2012 at 04:02:59PM +0100, demerphq wrote:
> >> Hash of lines + warning message (format or something).
> >
> > I first thought "optree - that's a bugger, that's read only" and then
> > considered that an interpreter-based hash of script filename and line
> > would work. But it still felt hackish.
> >
> > (Even if I decided that people who had used #line directives to have the
> > same line appear more than once were on their own.)
> >
> > I think you're right with using the format string - I'd not thought of that,
> > and it's possible that more than one warning might come from a complex
> > construction at different times. (Given that some of the warnings are run-
> > time based on the data)
> >
> > I suspect that "address of current op" is a cheaper thing to store than
> > "file plus line". That plus format should be good enough.
> Ah, nice refinement. I hadn't thought of using the opcode address at all. :-)

It was the result of thinking "file and line number come from the current
COP. We'd have to stringify and concatenate them. But COPs have (to have)
unique addresses - why don't we just use that instead. Oh wait, why even
bother looking for that - why not use the current OP's address?"

Nicholas Clark

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About