Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

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 ( #634140=note: print w/ replies, xml ) Need Help??


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

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++


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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://634140]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2014-09-22 01:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (176 votes), past polls