develooper Front page | perl.perl5.porters | Postings from November 2021

Re: Pre-RFC: Phaser Expressions

Thread Previous | Thread Next
From:
David Nicol
Date:
November 18, 2021 04:32
Subject:
Re: Pre-RFC: Phaser Expressions
Message ID:
CAFwScO-2ws6Cf8M3ByhNa+BJASHHyL5Yb2fsquON1ozhmBYwLQ@mail.gmail.com
I don't like it.

That said, if we must do this I'd like to see it postfix, like the other
non-bracketing modifiers that happen and ends of expressions, which are if,
while, unless, for, and possibly something else I missed. We would
introduce a new postfix expression keyword, "at" or "during" or "atphase"
or something like that, of the same class as postfix if and friends, and it
would only be syntactically correct when followed by one of the "phasers."

it would look like this:

my $initialized = 1 at INIT;

That's my two sunken rai stones.

On Wed, Nov 17, 2021 at 1:59 PM Branislav ZahradnĂ­k <happy.barney@gmail.com>
wrote:

> You got it little bit wrong. I'm not talking about treating phasers as a
> value expressions
> I'm talking about new grammar rule, shortly speaking:
>
> statement: variable-list '=' BEGIN block;
>
> vs
>
> statement: BEGIN variable-list = expression
>
> in both cases you (or someone who will implement this) has to some kind of
> AST transformation
> (I know, perly doesn't have AST layer) so expressions with different then
> BEGIN will make sense:
>
> INIT my $initialized = 1;
> vs.
> my $initialized = INIT {  1  };
>
> first variant will be misleading (especially for newbies - yes, I still
> believe that there is a willingness to attract some)
>
>

-- 
"Lay off that whiskey, and let that cocaine be!" -- Johnny Cash

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