develooper Front page | perl.perl6.language | Postings from May 2001

Re: Apoc2 - <STDIN> concerns

From:
John Porter
Date:
May 7, 2001 13:42
Subject:
Re: Apoc2 - <STDIN> concerns
Message ID:
20010507164239.B15625@min.net
Larry Wall wrote:
> We do have to worry about the C<next> loop control function though.
> It's possible that in
> 
>     FOO: while (1) {
> 	next FOO if /foo/;
> 	...
>     }
> 
> the C<FOO> label is actually being recognized as a pseudo-package
> name!  The loop could well be an object whose full name is C<MY::FOO>.
> Or something like that.  But maybe that's a gross hack.  Seems a bit
> odd to overload C<next> like that.  Maybe we need a different word.

Pardon me if someone has already suggested this, but...
Couldn't labels really be (aliases to) iterator objects?
So that
	next FOO
really *does* mean
	FOO.next

-- 
John Porter

All men are subjects.




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