Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Perl 6: Multiple subexpression modifiers with in a statement?

by BUU (Prior)
on Oct 02, 2003 at 18:32 UTC ( #296013=perlquestion: print w/replies, xml ) Need Help??

BUU has asked for the wisdom of the Perl Monks concerning the following question:

As I understand it right now, every piece of code is made of "statements". Each of these statements is made up of an "expression" and possibly an "expression modifier". The expression is of course something like "$a='b'", and the modifer is something along the lines of "if bar;" or "while foo". Currently, in perl5, you can only have one of these modifiers, so that $x = 'b' while(<foo>) if $bar; doesn't work. Anyone know if there is any planning to change this in perl6?

Replies are listed 'Best First'.
Re: Perl 6: Multiple subexpression modifiers with in a statement?
by Aristotle (Chancellor) on Oct 02, 2003 at 20:25 UTC
    I hope so - it would certainly be useful to be able to write
    s/foo/bar/ for @$_ for @LoL;
    Last I checked, it wasn't decided either way.

    Makeshifts last the longest.

Re: Perl 6: Multiple subexpression modifiers with in a statement?
by Elian (Parson) on Oct 03, 2003 at 13:12 UTC
    Yes. It'll work.

      Will it simply associate modifiers right-to-left? As in, the rightmost modifier modifies everything to the left of it, etc. What I'm getting at is that I don't want to have to think about something like "modifier precedence" when chaining them like this.

      kelan


      Perl6 Grammar Student

        It'll be strict right-to-left. Just don't throw mys in there, as proper scoping in chained modifiers is never what people expect, and may well just be disallowed.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://296013]
Approved by blokhead
Front-paged by grinder
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (3)
As of 2021-09-25 04:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?