Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: what would you like to see in perl5.12? (nested statement modifiers)

by ysth (Canon)
on Aug 21, 2007 at 06:12 UTC ( #634010=note: print w/replies, xml ) Need Help??

in reply to what would you like to see in perl5.12?

Nested statement modifiers are reportedly rejected by Larry for Perl 6, so presumably ruled out of court for Perl5 as well. Poking around shows this thread about a year ago, with someone citing Larry rejecting them 5 years ago.

If indeed this is final, all I can say is "too bad". I think all the arguments against multiple statement modifiers apply equally to single statement modifiers. And you may call it "enough rope", but rope can be awfully handy at times. If I have time, I may dig up a couple of examples where I would have used them, and people can laugh at me.

Update: another couple of Perl 6 threads, from 2003: Statement modifiers, Statement modifiers (yes, again)

  • Comment on Re: what would you like to see in perl5.12? (nested statement modifiers)

Replies are listed 'Best First'.
Re^2: what would you like to see in perl5.12? (nested statement modifiers)
by TimToady (Parson) on Aug 21, 2007 at 17:20 UTC
    Nevertheless, Rule 2 applies here: several months ago we decided it was okay for Perl 6 to allow a conditional modifier inside a loop modifier because it makes it easier to write list comprehensions close to the way mathematicians like to write them:
    %desc{$_} if .path for <n ne e se s sw w nw up down>
    Also, any parenthesized or bracketed expression is now parsed as a statement, so you can nest modifiers to your heart's content as long as you parenthesize. In particular, this allows you to use a list comprehension for a slice subscript.

    Update: changed @desc to %desc as noted by wolverian++

Re^2: what would you like to see in perl5.12? (nested statement modifiers)
by JavaFan (Canon) on Aug 07, 2008 at 14:37 UTC
    Actually, the main reason Perl5 doesn't have nested statement modifiers is that noone submitted a patch for it.

    About the only way to get your wish into Perl5 is to actually go do it. A single person writing a patch for nested modifiers increases the chance to get it added to Perl a million times more than a thousand perlmonks wishing for it in a thread.

      In many cases, I'd agree with you. This, though, is something people seem to have a real hangup over. The patch is pretty trivial (albeit writing tests is less so). But now that Larry has changed his mind, it should be an easier sell. (pause). There, the perly.y changes took about 45 seconds. Anybody want to help write tests?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://634010]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (4)
As of 2018-06-20 02:37 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (116 votes). Check out past polls.