develooper Front page | perl.perl5.porters | Postings from June 2020

Re: Announcing Perl 7

Thread Previous | Thread Next
From:
Christian Walde
Date:
June 28, 2020 14:57
Subject:
Re: Announcing Perl 7
Message ID:
op.0mxftzzoydyjqt@xenwide.cihq
On Sun, 28 Jun 2020 16:12:48 +0200, Christian Walde <walde.christian@gmail.com> wrote:

> On Sun, 28 Jun 2020 14:33:15 +0200, Andreas Koenig <andreas.koenig.7os6VVqR@franz.ak.mind.de> wrote:
>
>>>>>>> On Sun, 28 Jun 2020 03:39:52 -0500, Todd Rinaldo <toddr@cpanel.net> said:
>>
>>  >> On Jun 28, 2020, at 2:38 AM, Paul LeoNerd Evans <leonerd@leonerd.org.uk> wrote:
>>  >>
>>  >> If `try` syntax becomes default - probably not in 7 but maybe in 8 -
>>  >> then how is perltidy going to know how to properly format and indent
>>  >> this, and all the other exciting syntax we hope to have in place by 8?
>>  >>
>>
>>   > Easily. They check $].
>>
>> Hi Todd,
>>
>> this does not work. For example, see here is a line of perl code:
>>
>>   print "Hello, Rinaldo";
>>
>> So what is $] in this line and how do you find out? If you simply run
>> it, you make a decision, with which interpreter you start it. And hereby
>> you influence the outcome for $]. So: the value of $] is a result of
>> your decision, not something intrinsic to the code.
>
> As maintainer of the perl document parsing module PPI this is also a massive concern for me.
>
> It needs to load and interpret perl from many sources, including stuff not intended to run on the current interpreter.
>
> The version of the current perl interpreter does literally nothing to help PPI process a script intended to run on a server somewhere else.
>
> Having *more* wide-spread perl version requirements in perl modules and scripts would be an absolute godsend to PPI and frankly ...
>
> ... i hesitate to express this, but ...
>
> I'm livid that PPI is going to be denied this functionality improvement just to save people from typing 7 letters.
>
> There's also the absolutely brain-bending reality that under perl BELOW v7, no version means "oldest perl feature set", while under v7 no version means "newest feature set" ... and being unable to know under which version the code is targeted to run, how is PPI going to solve this? How's it gonna decide how to parse an indirect-looking call?
>
> https://i.imgur.com/Q8EvkXU.png
>
> I'm going to have to have to implement two parsing modes parametrized by a version assumption passed into the constructor. All upstream users of PPI will have to do the same. Am i allowed to be angry about this? Can you imagine how i feel?
>
> Also recommend talking to the Perl::Critic team.
>
> Have a nice sunday y'all. :3

To be unmistakably clear here, this is my concern:

     use PPI;
     use PPI::Dumper;

     my $perl = 'sub foo ($left, $right) {}';

     PPI::Dumper->new(PPI::Document->new(\$perl))->print;

     __END__

     PPI::Document
       PPI::Statement::Sub
         PPI::Token::Word    'sub'
         PPI::Token::Whitespace      ' '
         PPI::Token::Word    'foo'
         PPI::Token::Whitespace      ' '
         PPI::Token::Prototype       '($left, $right)'
         PPI::Token::Whitespace      ' '
         PPI::Structure::Block       { ... }

-- 
With regards,
Christian Walde

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