Re: Re: Labeled Breaks (not the G-word)
| From: | Joao Cruz Morais | Date: | Wed, 30 Nov 2005 01:24:54 +0000 |
| Subject: | Re: Re: Labeled Breaks (not the G-word) | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-20862@lists.php.net to get a copy of this message | ||
I'm sorry if I'm saying something that was already proposed, but why
not use the Java approach to labeled breaks or something like this
(dumb) example:
while(true) as outer_cycle {
$i = 0;
while(true)
if($i++ == 10) break outer_cycle;
}
Regards,
João C Morais
On 11/29/05, Sara Golemon <pollita@php.net> wrote:
> > My objection to goto is based on the fact that it allows to randomly
> > transfer control between arbitary points of script, which can (and
> > will) easily lead to spaghetti code and actually promotes this style of
> > writing code.
> >
> Yes, I agree... Exceptions cause exactly that kind of confus...oh..wait.....
> you were talking about goto, my mistake... Sure sounded like exception
> behavior to me. I guess with exceptions you get the benefit of not knowing
> where execution is arbitrarily jumping to. Getting to guess what file/scope
> you have to look in to find the catcher... Yeah, that's much better.
>
> > It has nothing to do with goto cleaning or not cleaning anything.
> >
> "Exceptions allow passing control to specific well-defined points with stack
> unwinding, etc. What this has to do with goto?"
>
> Why point out that exceptions do clean up after themselves then? What
> argument are you really trying to make?
>
> > Please drop this tinfoil-hat conspiracy baloney, really. It's not funny...
> >
> Logic doesn't seem to have a place in this conversation, so we all might as
> well have some fun and just toss it to the wind eh?
>
> -Sara
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>