Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: removing the old-style package separator

259 views
Skip to first unread message

Uri Guttman

unread,
Aug 15, 2021, 12:15:03 AM8/15/21
to perl5-...@perl.org
On 8/14/21 11:08 PM, Ricardo Signes wrote:
Porters,

Since at least 2009, we have been talking, once in a while, about deprecating the use of \N{APOSTROPHE} as a package separator, Ada style.

The following two expressions are equivalent:
$x::y::z

$x'y'z

while i totally agree with this, there are some modules with the name d'oh in them!

  use D'oh 'i_hate_this_program';
    D'oh::stderr('/tmp/stderr'); # redirect all stderr to /tmp/stderr
 

D'oh::Year - Catch stupid mistakes when mucking with years, like Y2K bugs


and both seem to do something real and are not in acme::

uri


James E Keenan

unread,
Aug 15, 2021, 9:30:02 AM8/15/21
to perl5-...@perl.org
On 8/14/21 11:08 PM, Ricardo Signes wrote:
> Porters,
>
> Since at least 2009 <http://markmail.org/message/gaux5xx5jlop3vmk>, we
> have been talking, once in a while, about deprecating the use of
> \N{APOSTROPHE} as a package separator, Ada style.
>

So *that's* where that came from!

[snip]

>
> Shall we carry on to
> RFC this?
>

Yes.

Arne Johannessen

unread,
Aug 17, 2021, 7:30:03 AM8/17/21
to Perl 5 Porters
H.Merijn Brand wrote:
> On Tue, 17 Aug 2021 18:05:03 +0900, Yuki Kimoto <kimot...@gmail.com>
> wrote:
>>
>> In my experience, the library jcode.pl seems to use ’ as package
>> separator.
>
> And what is the target version of perl in that script? What package
> does it belong to? When was its latest update? Is it likely that that
> script will be updated to use recent perl (if it does not already)?

Jacode is on CPAN and requires Perl v5.5.30:
<https://metacpan.org/dist/Jacode/view/lib/jacode.pl>

I'd be more concerned about Test::More::isn't(), which seems to be one of the very few cases (perhaps the only one?) in which users would intentionally use the old-style separator in new Perl 5 code. But I expect the usual deprecation period will enable basically everyone to handle these cases fine.

+1 on considering this a tiny win.


--
Arne Johannessen

Dave Mitchell

unread,
Aug 30, 2021, 6:45:05 AM8/30/21
to Ricardo Signes, Perl 5 Porters
On Sat, Aug 14, 2021 at 11:08:40PM -0400, Ricardo Signes wrote:
> The following two expressions are equivalent:
> $x::y::z
>
> $x'y'z

Are we talking about just removing the parsing of "'" in package names in
source code, or more generally the run-time processing of package names,
e.g.

sub a::b { print "a::b called\n" }
my $name = "a'b";
&{$name}();


--
Music lesson: a symbiotic relationship whereby a pupil's embellishments
concerning the amount of practice performed since the last lesson are
rewarded with embellishments from the teacher concerning the pupil's
progress over the corresponding period.

Paul "LeoNerd" Evans

unread,
Sep 3, 2021, 11:30:04 AM9/3/21
to perl5-...@perl.org
On Mon, 30 Aug 2021 11:31:55 +0100
Dave Mitchell <da...@iabyn.com> wrote:

> On Sat, Aug 14, 2021 at 11:08:40PM -0400, Ricardo Signes wrote:
> > The following two expressions are equivalent:
> > $x::y::z
> >
> > $x'y'z
>
> Are we talking about just removing the parsing of "'" in package
> names in source code, or more generally the run-time processing of
> package names, e.g.
>
> sub a::b { print "a::b called\n" }
> my $name = "a'b";
> &{$name}();

I think the primary motivation was to catch it in string interpolation,
because of the common failures like

print "$name's score is 10\n";

Next up is general static source, and finally symbolic references.
Perhaps it could be attacked in several phases.

--
Paul "LeoNerd" Evans

leo...@leonerd.org.uk | https://metacpan.org/author/PEVANS
http://www.leonerd.org.uk/ | https://www.tindie.com/stores/leonerd/

H.Merijn Brand

unread,
Oct 7, 2021, 7:00:05 AM10/7/21
to Ricardo Signes, Dave Mitchell, Perl 5 Porters
On Fri, 03 Sep 2021 11:35:06 -0400, "Ricardo Signes"
<perl...@rjbs.manxome.org> wrote:

> On Mon, Aug 30, 2021, at 6:31 AM, Dave Mitchell wrote:
> > On Sat, Aug 14, 2021 at 11:08:40PM -0400, Ricardo Signes wrote:
> > > The following two expressions are equivalent:
> > > $x::y::z
> > >
> > > $x'y'z
> >
> > Are we talking about just removing the parsing of "'" in package
> > names in source code, or more generally the run-time processing of
> > package names,
>
> As Paul said, the *primary* motivation was confusion possible in
> string interpolation, but I think we're better off removing it
> everywhere, rather than producing more special cases.

+1!

And just disregard Acme::Don::t and WWW::Scripter'Location

--
H.Merijn Brand https://tux.nl Perl Monger http://amsterdam.pm.org/
using perl5.00307 .. 5.33 porting perl5 on HP-UX, AIX, and Linux
https://tux.nl/email.html http://qa.perl.org https://www.test-smoke.org

0 new messages