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

[email protected] (Jonathan Scott Duff) Thu, 31 Aug 2000 13:47:47 -0500
Newsgroups perl.perl6.language.flow
Message-ID <[email protected]>
On Thu, Aug 31, 2000 at 01:26:26PM -0500, Christopher J. Madsen wrote:
> I too would like to see last, next, & redo work with do loops.

*Only* do loops or do blocks in general?  And what should they do?

	do { ... last; ... };		# exit the block immediately
	do { ... next; ... };		# equivalent to last?
	do { ... redo; ... };		# equivalent to last?

These fall right in line with the proposal that the "do" be optional
since we can already do these:

	{ ... last; ... }
	{ ... next; ... }
	{ ... redo; ... }

And what about continue blocks?  We can attach them to bare blocks,
but not to do blocks?  That's weird.

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

Indeed.

-Scott
-- 
Jonathan Scott Duff
[email protected]