develooper Front page | perl.perl5.porters | Postings from August 2013

[perl #117087] forbid empty parts in package names

Thread Previous | Thread Next
From:
Father Chrysostomos via RT
Date:
August 5, 2013 06:37
Subject:
[perl #117087] forbid empty parts in package names
Message ID:
rt-3.6.HEAD-2552-1375684640-925.117087-15-0@perl.org
On Sun Aug 04 19:02:50 2013, tonyc wrote:
> On Sun Aug 04 18:59:28 2013, tonyc wrote:
> > On Wed Jul 31 22:29:40 2013, tonyc wrote:
> > > I've attached the rebased patches, but the final patch is obviously
> > > incomplete.
> > 
> > Brian updated his branch on github, I've attached the new patch series.
> > 
> > Tony
> 
> The only questionable part to me (besides some whitespace issues), is
> this modification to S_scan_word():
> 
> @@ -9360,6 +9396,8 @@ S_scan_word(pTHX_ char *s, char *dest, STRLEN
> destlen, int allow_package, STRLEN
>      parse_ident(&s, &d, e, allow_package, is_utf8);
>      *d = '\0';
>      *slp = d - dest;
> +    if ( allow_package && *slp && *slp >= 4 )
> +            deprecate_empty_packages(dest);
>      return s;
>  }
>  
> I know parsers (and especially perl's parser) tend to be messy, but I'm
> not sure that check belongs in scan_word - changing it from "scan a
> word" to "scan a word and optionally warn".

That could be problematic if scan_word is called multiple times for the
same word, which is not implausible.  Finding out whether that can
happen will take some work.

> Unless someone else speaks up I plan to apply it as is (with whitespace
> fixes.)

Are we going to apply it before we have even discussed why we are
deprecating this, i.e., what problem we are trying to solve?

Also, deprecating leading :: except when a sub with that name exists
doesn’t make sense to me.  That’s deprecating something except when
people use it.

-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=117087

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About