develooper Front page | perl.perl6.language.flow | Postings from August 2000

Re: The distinction between "do BLOCK while COND" and "EXPR while COND" should go

From:
Christopher J. Madsen
Date:
August 31, 2000 11:20
Subject:
Re: The distinction between "do BLOCK while COND" and "EXPR while COND" should go
Message ID:
20000831132626990.Chris.Madsen@trx.com
Tom Christiansen writes:
 > >>One could argue that do{} should take return so it might have a value,
 > >>but this will definitely annoy the C programmers.
 > 
 > >So what.
 > 
 > So what is that it *already* annoys us, which is *why* we would like to 
 > last out of a do.  Perhaps you should be able to last out if a retval
 > isn't wanted (as in do {} while) but should return out if one is? 
 > Or maybe a last should be an undef return?

I too would like to see last, next, & redo work with do loops.  I
don't particularly care what they return; I don't think I've ever
written a do loop where I used the return value.

However, I really don't want to see 'return' become a kind of 'last'
for do{}.  How would I return from a subroutine from within a do loop?

-- 
Chris Madsen              http://www.trx.com      Chris.Madsen@trx.com
TRX Technology Services                                 (214) 346-4611




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About