Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^8: Unhappy returns

by Aristotle (Chancellor)
on Oct 10, 2005 at 14:38 UTC ( [id://498905]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re^7: Unhappy returns
in thread Unhappy returns

by your argument, @x = do { for (1) { 1 } }; should be a syntax error, too, and it isn’t.

Huh? do {} is an expression that evaluates a block. (And like a function call, it too returns the value of the last expression evaluated.) Blocks may contain statements. How is that inconsistent with sauoq’s point?

Makeshifts last the longest.

Replies are listed 'Best First'.
Re^9: Unhappy returns
by ysth (Canon) on Oct 11, 2005 at 00:33 UTC
    Careful, when you say "evaluates a block", you are almost coming right out and stating that a block has a return value :). Which was my point: what could it mean to evaluate a block containing only a for statement? If a for statement doesn't have a return value, it shouldn't even be valid syntax.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://498905]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.