GOTO and/or BREAK LABEL

php.internals

Dmitry Stogov

20 years ago
Hi, Because of some confused people I reverted "break label" patch and post it for discussion once again together with GOTO patch. Please reviw and vote. 1) goto and break label 2) goto only (like C) 3) break label only (like Java) 4) nothing My vote: (1) +0.5, (4) +0.5 Thanks. Dmitry.

Sascha Schumann

20 years ago
On Tue, 7 Mar 2006, Dmitry Stogov wrote:
> Hi, > > Because of some confused people I reverted "break label" patch and post it > for discussion once again together with GOTO patch. > > Please reviw and vote. > > 1) goto and break label > 2) goto only (like C) > 3) break label only (like Java) > 4) nothing
5) goto, fowarding-jumping only. - Sascha

Derick Rethans

20 years ago
On Tue, 7 Mar 2006, Sascha Schumann wrote:
> On Tue, 7 Mar 2006, Dmitry Stogov wrote: > > > Hi, > > > > Because of some confused people I reverted "break label" patch and post it > > for discussion once again together with GOTO patch. > > > > Please reviw and vote. > > > > 1) goto and break label > > 2) goto only (like C) > > 3) break label only (like Java) > > 4) nothing > > 5) goto, fowarding-jumping only.
Yes I agree with that if you mean by forwarding: down and out of scope only (not into loop constructs). I would assume you mean that though. Derick
-- Derick Rethans http://derickrethans.nl | http://ez.no | http://xdebug.org

Hartmut Holzgraefe

20 years ago
Sascha Schumann wrote:
> 5) goto, fowarding-jumping only.
which would more or less make it useless for state machine stuff, right?
-- Hartmut Holzgraefe, Senior Support Engineer . MySQL AB, www.mysql.com Join me at MySQL's 2006 Users Conference, April 24-27! http://www.mysqluc.com/

Edin Kadribasic

20 years ago
Dmitry Stogov wrote:
> Please reviw and vote. > > 1) goto and break label > 2) goto only (like C) > 3) break label only (like Java) > 4) nothing
1) +1 Edin

Michael Wallner

20 years ago
Dmitry Stogov wrote:
> 1) goto and break label
+0
> 3) break label only (like Java)
+1 Regards,
-- Michael - <mike(@)php.net> http://dev.iworks.at/ext-http/http-functions.html.gz

Rasmus Lerdorf

20 years ago
Michael Wallner wrote:
> Dmitry Stogov wrote: > >> 1) goto and break label > +0 > >> 3) break label only (like Java) > +1
You do realize that this is: label: while(condition) { break label; } As a C programmer this confuses me to no end. When I see "label:" I expect control to end up there and the loop to be executed again. I realize all the Java folks have gotten used to this, but I don't think I ever will. -Rasmus

Michael Wallner

20 years ago
Rasmus Lerdorf wrote:
> Michael Wallner wrote: > >> Dmitry Stogov wrote: >> >>> 1) goto and break label >> >> +0 >> >>> 3) break label only (like Java) >> >> +1 > > > You do realize that this is: > > label: > while(condition) { > break label; > } > > As a C programmer this confuses me to no end. When I see "label:" I > expect control to end up there and the loop to be executed again. I > realize all the Java folks have gotten used to this, but I don't think I > ever will.
Yes, but it's quite obvious to me if I replace the labeled break with `break 1;` I'd expect `continue label;` to step into the loop again. By the way, +0 does not mean -1 for goto. Regards,
-- Michael - <mike(@)php.net> http://dev.iworks.at/ext-http/http-functions.html.gz

Stanislav Malyshev

20 years ago
RL>>As a C programmer this confuses me to no end. When I see "label:" I expect The question is should all languages be like C? So, C has it that way, and Java and Perl have it other way. We don't move to prefix notation because Forth has it ;)
-- Stanislav Malyshev, Zend Products Engineer stas@zend.com http://www.zend.com/ +972-3-6139665 ext.115

Rasmus Lerdorf

20 years ago
Stanislav Malyshev wrote:
> RL>>As a C programmer this confuses me to no end. When I see "label:" I expect > > The question is should all languages be like C? So, C has it that way, and > Java and Perl have it other way. We don't move to prefix notation because > Forth has it ;)
No, obviously all languages shouldn't be like C and PHP has plenty of stuff that looks nothing like C, but like it or not, a lot of PHP's syntax came from C and I don't think we should be adding syntax that looks like something from C but doesn't act like it. I still think this is a really fringe feature that isn't worth one of the first forward compatibility breaks in the procedural language in years. -Rasmus

Dmitry Stogov

20 years ago
Rasmus, C hasn't "break label;", and I don't understand why Java way confising C people. It is clear and fit into structured programming. Thanks. Dmitry.

Rasmus Lerdorf

20 years ago
Dmitry Stogov wrote:
> Rasmus, > > C hasn't "break label;", and I don't understand why Java way confising C > people. > It is clear and fit into structured programming.
But the thing doesn't say: this-is-a-break-label label: It just says: label: Which would lead me to write something like: label_a: $i=0; label_b: $i++; while($i<10) { if(foo()) continue label_b; else { if(bar($i++)) goto label_a; } } That doesn't make any sense, of course, but I was led astray by a familiar-looking language construct not doing what I expected. We have to remember our audience here. And yes, for the record, my vote is for (2) or (4). The others smell like design by committee compromises to me. -Rasmus

Sara Golemon

20 years ago
> label_a: > $i=0; > label_b: > $i++; > while($i<10) { > if(foo()) continue label_b; > else { > if(bar($i++)) goto label_a; > } > } >
And that would be a parse error. break/continue label only works when the label IMMEDIATELY preceeds the loop construct thus saying "I identify this loop at `label_foo`". Here's another reason for break being distinct from goto: foo: foreach($arr as $val) { if (cond1) break foo; /* Leave the loop entirely */ if (cond2) continue foo; /* Jump to next itteration in loop */ if (cond3) goto foo; /* Restart the loop from the beginning */ } Each type of label-targeted statement does a different thing. But if that is ((really)) is confusing then you're right, it's not a good thing. break 1;/continue 1; would cover the first two conditions in that example just fine. To me, I see more consistency in working on the foo loop with foo on all statements. -Sara Still +1 goto, +0 goto with labeled breaks.

Stanislav Malyshev

20 years ago
RL>>I still think this is a really fringe feature that isn't worth one of RL>>the first forward compatibility breaks in the procedural language in RL>>years. For the record, I'm happy even without either feature :) but I remember labeled break was quite useful for me in Perl - and it seems to me that PHP has something from Perl too... Of course, the question is how much of each we want, but I guess that's a matter of tastes.
-- Stanislav Malyshev, Zend Products Engineer stas@zend.com http://www.zend.com/ +972-3-6139665 ext.115

Derick Rethans

20 years ago
On Tue, 7 Mar 2006, Rasmus Lerdorf wrote:
> Michael Wallner wrote: > > > 3) break label only (like Java) > > +1 > > You do realize that this is: > > label: > while(condition) { > break label; > } > > As a C programmer this confuses me to no end. When I see "label:" I expect > control to end up there and the loop to be executed again. I realize all the > Java folks have gotten used to this, but I don't think I ever will.
Nor would I... this is a "NONO" for me. Derick

Bart de Boer

20 years ago
Rasmus Lerdorf wrote:
> Michael Wallner wrote: >> Dmitry Stogov wrote: >> >>> 1) goto and break label >> +0 >> >>> 3) break label only (like Java) >> +1 > > You do realize that this is: > > label: > while(condition) { > break label; > } > > As a C programmer this confuses me to no end. When I see "label:" I > expect control to end up there and the loop to be executed again. I > realize all the Java folks have gotten used to this, but I don't think I > ever will. > > -Rasmus
If we do both goto and labeled breaks you can get your expected behaviour with: label: while(condition) { goto label; } right? Using break in the un-expected way together with goto gives you both options. FWIW (And that's probably not much ;) ) my vote would be: 1) 1 (goto and break label) 2) 0 3) 0 4) 0 Bart

Stanislav Malyshev

20 years ago
DS>>1) goto and break label DS>>2) goto only (like C) DS>>3) break label only (like Java) DS>>4) nothing 1) +0.5 2) -1 3) +1
-- Stanislav Malyshev, Zend Products Engineer stas@zend.com http://www.zend.com/ +972-3-6139665 ext.115

Antony Dovgal

20 years ago
On 07.03.2006 11:28, Dmitry Stogov wrote:
> Hi, > > Because of some confused people I reverted "break label" patch and post it > for discussion once again together with GOTO patch. > > Please reviw and vote. > > 1) goto and break label > 2) goto only (like C) > 3) break label only (like Java) > 4) nothing
2) +0.5 4) +0.5
-- Wbr, Antony Dovgal

Wez Furlong

20 years ago
On 3/7/06, Dmitry Stogov <dmitry@zend.com> wrote:
> 1) goto and break label
+1 I'm happy with goto, but don't mind getting labelled breaks "for free"; labels are better than numbers.
> 2) goto only (like C)
+1
> 3) break label only (like Java)
+0.5, but only if we don't have goto --Wez.

Pierre Joye

20 years ago
On 3/7/06, Wez Furlong <kingwez@gmail.com> wrote:
> On 3/7/06, Dmitry Stogov <dmitry@zend.com> wrote: > > 1) goto and break label > +1 > > I'm happy with goto, but don't mind getting labelled breaks "for > free"; labels are better than numbers.
same here +1
> > 2) goto only (like C)
+1
> > 3) break label only (like Java) > +0.5, but only if we don't have goto
+0 --Pierre

Zeev Suraski

20 years ago
At 11:28 07/03/2006, Dmitry Stogov wrote:
>Hi, > >Because of some confused people I reverted "break label" patch and post it >for discussion once again together with GOTO patch. > >Please reviw and vote. > >1) goto and break label >2) goto only (like C) >3) break label only (like Java) >4) nothing > >My vote: (1) +0.5, (4) +0.5
(3) +0.5 (4) +1

Xuefer Tinys

20 years ago
On 3/7/06, Dmitry Stogov <dmitry@zend.com> wrote: > Hi, > > Because of some confused people I reverted "break label" patch and post it > for discussion once again together with GOTO patch. > > Please reviw and vote. > > 1) goto and break label > 2) goto only (like C) > 3) break label only (like Java) > 4) nothing > thanks for this thread. +0.5 for goto +1 for "do { break label; } while(0); label:" (line label, same with goto) or if the above is not acceptable, +0.5 for java like "label: do { break label; } while(0);" (block label, confusing with goto)

Ilia A.

20 years ago
Dmitry Stogov wrote:
> 1) goto and break label
+1
> 2) goto only (like C)
+1
> 3) break label only (like Java)
-1 Ilia

Steph

20 years ago
> 1) goto and break label > 2) goto only (like C) > 3) break label only (like Java) > 4) nothing
Thanks for giving this a final chance, Dmitry. 1) +0.5 3) +1 - Steph

Christian Stocker

20 years ago
On 7.3.2006 15:44 Uhr, Steph Fox wrote:
>> 1) goto and break label >> 2) goto only (like C) >> 3) break label only (like Java) >> 4) nothing
In Sean's words: 1) 0 2) 0 3) 0 4) 0 Sorry for the noise. I was told to vote. Meaning, I don't care, never had a use for GOTO, but if the caring majority thinks, it's needed, why not :) chregu
-- christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich phone +41 44 240 56 70 | mobile +41 76 561 88 60 | fax +41 1 240 56 71 http://www.bitflux.ch | christian.stocker@bitflux.ch | GPG 0x5CE1DECB

Sebastian Bergmann

20 years ago
Christian Stocker schrieb:
> 1) 0 > 2) 0 > 3) 0 > 4) 0 > > Sorry for the noise. I was told to vote. > > Meaning, I don't care, never had a use for GOTO, but if the caring > majority thinks, it's needed, why not :)
Same here.
-- Sebastian Bergmann http://www.sebastian-bergmann.de/ GnuPG Key: 0xB85B5D69 / 27A7 2B14 09E4 98CD 6277 0E5B 6867 C514 B85B 5D69

Nuno Lopes

20 years ago
> On 7.3.2006 15:44 Uhr, Steph Fox wrote: >>> 1) goto and break label >>> 2) goto only (like C) >>> 3) break label only (like Java) >>> 4) nothing > > Sorry for the noise. I was told to vote. > > Meaning, I don't care, never had a use for GOTO, but if the caring > majority thinks, it's needed, why not :) > > chregu
same here. 1) -1 2) 0.5 3) -1 4) 0 Nuno

Greg Beaver

20 years ago
Dmitry Stogov wrote:
> Hi, > > Because of some confused people I reverted "break label" patch and post it > for discussion once again together with GOTO patch. > > Please reviw and vote. > > 1) goto and break label > 2) goto only (like C) > 3) break label only (like Java) > 4) nothing
For what it is worth: 1) +0.5 2) +1 3) +0 4) -1 I don't see any real benefit to break label as the deepest I have ever seen is 3 levels of break. I have run up against too many situations where the only way to lex something effectively in PHP is with pcre. The ability to port a tool like re2c would make it far easier to do things efficiently without having to write a new PHP extension. I doubt any users will suddenly start peppering goto all over their source, I just can't see that happening when there are so many other great loop constructs available. Discouraging its use is easy - just make sure the manual makes it really unattractive and has examples of better ways to implement goto using for/foreach/while. Greg

Andi Gutmans

20 years ago
I'm with Rasmus on the break label stuff. Although it's not confusing to me, I got convinced quickly that it'll be confusing to the wider audience. So big -1 from me for (2) & (1). I think we should either stick with nothing or go to a full goto (without jumping into scopes of course). Only forward gotos would go against one of the main initial motivations for discussing this which was state machines. I suggest we apply this and allow people to play around with it/test it.... Btw, how about naming it "jump" and not "goto"? :) Andi At 01:28 AM 3/7/2006, Dmitry Stogov wrote:

Edin Kadribasic

20 years ago
Andi Gutmans wrote:
> I'm with Rasmus on the break label stuff. Although it's not confusing to > me, I got convinced quickly that it'll be confusing to the wider > audience. So big -1 from me for (2) & (1).
From your comment bellow I figure you're for option 2, right? Edin

Andi Gutmans

20 years ago
Yes 2. Sorrry At 07:28 AM 3/7/2006, Edin Kadribasic wrote:

Rob Richards

20 years ago
Dmitry Stogov wrote:
> 1) goto and break label >
+0.5
> 2) goto only (like C) >
+1
> 3) break label only (like Java) >
-1 Rob

Sara Golemon

20 years ago
> 1) goto and break label
+0 Making goto's labels work with break is cheap, but less vital than goto.
> 2) goto only (like C)
+1 Within scope and out of break context is a given. My preference is to not limit jumping to forward only, though such a limit would still be a step in the right direction.
> 3) break label only (like Java)
0 See #1
> 4) nothing
-1

Mike Lively

20 years ago
On Tue, 2006-03-07 at 12:28 +0300, Dmitry Stogov wrote:
> Hi, > > Because of some confused people I reverted "break label" patch and post it > for discussion once again together with GOTO patch. > > Please reviw and vote. > > 1) goto and break label > 2) goto only (like C) > 3) break label only (like Java) > 4) nothing > > My vote: (1) +0.5, (4) +0.5 > > Thanks. Dmitry. > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php
1) +0 2) +1 3) -1 4) -1 I personally think labelled breaks are more fluff than anything. Like Greg I just haven't seen any examples of trying to break out of more than 3 loops in live code and I only recall seeing that once.

Magnus Maatta

20 years ago
Hi, On Tuesday 07 March 2006 10:28, Dmitry Stogov wrote:
> 1) goto and break label
+1
> 2) goto only (like C)
+1
> 3) break label only (like Java)
-1
> 4) nothing
-1 Regards, Magnus "Currently 'a bit' inactive" Määttä

Andrei Zmievski

20 years ago
(2) +1e10 On Mar 7, 2006, at 1:28 AM, Dmitry Stogov wrote:

Robert Cummings

20 years ago
On Tue, 2006-03-07 at 04:28, Dmitry Stogov wrote:
> Hi, > > Because of some confused people I reverted "break label" patch and post it > for discussion once again together with GOTO patch. > > Please reviw and vote. > > 1) goto and break label > 2) goto only (like C) > 3) break label only (like Java) > 4) nothing
2) +1 What's the policy on voting btw? Am I allowed? Cheers, Rob.
-- .------------------------------------------------------------. | InterJinn Application Framework - http://www.interjinn.com | :------------------------------------------------------------: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `------------------------------------------------------------'

Andi Gutmans

20 years ago
At 09:50 AM 3/7/2006, Robert Cummings wrote:
>On Tue, 2006-03-07 at 04:28, Dmitry Stogov wrote: > > Hi, > > > > Because of some confused people I reverted "break label" patch and post it > > for discussion once again together with GOTO patch. > > > > Please reviw and vote. > > > > 1) goto and break label > > 2) goto only (like C) > > 3) break label only (like Java) > > 4) nothing > >2) +1 > >What's the policy on voting btw? Am I allowed?
Sure you can vote. Doesn't mean we'll listen to you though :) Andi

Robert Cummings

20 years ago
On Tue, 2006-03-07 at 12:50, Andi Gutmans wrote:
> At 09:50 AM 3/7/2006, Robert Cummings wrote: > >On Tue, 2006-03-07 at 04:28, Dmitry Stogov wrote: > > > Hi, > > > > > > Because of some confused people I reverted "break label" patch and post it > > > for discussion once again together with GOTO patch. > > > > > > Please reviw and vote. > > > > > > 1) goto and break label > > > 2) goto only (like C) > > > 3) break label only (like Java) > > > 4) nothing > > > >2) +1 > > > >What's the policy on voting btw? Am I allowed? > > Sure you can vote. Doesn't mean we'll listen to you though :)
That's better then nothing. At least I feel included ;) Cheers, Rob.
-- .------------------------------------------------------------. | InterJinn Application Framework - http://www.interjinn.com | :------------------------------------------------------------: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `------------------------------------------------------------'

John Coggeshall

20 years ago
if($choice == 1) { goto bad; } else if ($choice == 2) { goto good; } else if ($choice == 3) { goto bad; } else if ($choice == 4) { goto good; } good: $vote++; bad: return; On Tue, 2006-03-07 at 12:50 -0500, Robert Cummings wrote:

Robert Cummings

20 years ago
On Tue, 2006-03-07 at 12:58, John Coggeshall wrote:
> if($choice == 1) { > goto bad; > } else if ($choice == 2) { > goto good; > } else if ($choice == 3) { > goto bad; > } else if ($choice == 4) { > goto good; > } > > good: > $vote++; > bad: > return;
I don't remember, but I think Sarah Golemon allowed for it in one of her patches way back: <?php $map = array ( 1 => 'bad', 2 => 'good', 3 => 'bad', 4 => 'acceptable', ); goto $map[$choice]; good: vote += .5; acceptable: vote += .5; bad: return; ?> For the record, I wouldn't normally fall through like that, but we're just having fun :B Cheers, Rob.
-- .------------------------------------------------------------. | InterJinn Application Framework - http://www.interjinn.com | :------------------------------------------------------------: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `------------------------------------------------------------'

Johannes Schlueter

20 years ago
Hi, On Tuesday 07 March 2006 19:14, Robert Cummings wrote:
> I don't remember, but I think Sarah Golemon allowed for it in one of her > patches way back: > > <?php > > $map = array > ( > 1 => 'bad', > 2 => 'good', > 3 => 'bad', > 4 => 'acceptable', > ); > > goto $map[$choice];
NOOO - If we add goto only with static labels. Everything else is a total mess. johannes

Sara Golemon

20 years ago
> I don't remember, but I think Sarah Golemon allowed for it in one of her > patches way back: > > goto $map[$choice]; >
Yes, and targeting dynamic labels was one of the first big sacrifices on the altar of compromise. Current implementation options use static, compile-time resolved labels only. -Sara (no h thank you)

Robert Cummings

20 years ago
On Tue, 2006-03-07 at 13:52, Sara Golemon wrote:
> > I don't remember, but I think Sarah Golemon allowed for it in one of her > > patches way back: > > > > goto $map[$choice]; > > > Yes, and targeting dynamic labels was one of the first big sacrifices on the > altar of compromise. Current implementation options use static, > compile-time resolved labels only.
Yeah I remember that too -- vaguely (it's been a long time). Still, dynamic labels were never very important IMHO.
> -Sara (no h thank you)
My apologies, my wife's name is Sarah so the 'h' just seems to flow :) Cheers, Rob.
-- .------------------------------------------------------------. | InterJinn Application Framework - http://www.interjinn.com | :------------------------------------------------------------: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `------------------------------------------------------------'

Steph

20 years ago
I took that as (2) +1, (4) +1. Current raw totals amongst those who contribute to the PHP core: (1) +5.5, (2) +9.5, (3) +0, (4) 2 Still to vote: Derick, Marcus, George, Sascha, Hartmut, Chregu, Johannes, Sebastian, Stefan, apologies if I missed any names here. Current raw totals amongst all votes: (1) +7.5, (2) +13, (3) +0.5, (4) 0 Still notably haven't heard from: Lukas, Nuno, Alan K, Sean... ----- Original Message ----- From: "John Coggeshall" <john@coggeshall.org> To: "Robert Cummings" <robert@interjinn.com> Cc: "Dmitry Stogov" <dmitry@zend.com>; <internals@lists.php.net> Sent: Tuesday, March 07, 2006 7:58 PM Subject: Re: [PHP-DEV] GOTO and/or BREAK LABEL

Sean Coates

20 years ago
Steph Fox wrote:
> Still notably haven't heard from: Lukas, Nuno, Alan K, Sean...
1) 0 2) 0 3) 0 4) 0 Sorry for the noise. I was told to vote. I don't personally have much use for goto, and I see both sides. I also only run PHP on dedicated platforms, so if appropriate engine mods were made (if necessary), and goto went into PECL that would be best for me. S

Derick Rethans

20 years ago
On Tue, 7 Mar 2006, Steph Fox wrote:
> I took that as (2) +1, (4) +1. > > Current raw totals amongst those who contribute to the PHP core: (1) +5.5, (2) > +9.5, (3) +0, (4) 2 > > Still to vote: Derick, Marcus, George, Sascha, Hartmut, Chregu, Johannes, > Sebastian, Stefan, apologies if I missed any names here.
I think Sascha and I already did... anyway, I go: (1) -1 (2) +1 (3) -1 (4) -1 Derick

Hartmut Holzgraefe

20 years ago
Steph Fox wrote:
> Still to vote: Derick, Marcus, George, Sascha, Hartmut, Chregu, > Johannes, Sebastian, Stefan, apologies if I missed any names here.
1) -1 2) +1 3) +.5 4) -0
-- Hartmut Holzgraefe, Senior Support Engineer . MySQL AB, www.mysql.com Join me at MySQL's 2006 Users Conference, April 24-27! http://www.mysqluc.com/

Johannes Schlueter

20 years ago
Hi, On Tuesday 07 March 2006 19:18, Steph Fox wrote:
> Current raw totals amongst those who contribute to the PHP core: (1) +5.5, > (2) +9.5, (3) +0, (4) 2 > > Still to vote: Derick, Marcus, George, Sascha, Hartmut, Chregu, Johannes, > Sebastian, Stefan, apologies if I missed any names here.
Alright, my vote: 1) -1 2) +1 3) -1 4) 0 johannes

Alan Knowles

20 years ago
2) +1 Since I can see it's use, and I've already seen 101 ways to write spagetti code, so 102 ways isnt much different ;) Regards Alan Steph Fox wrote:

Lukas Smith

20 years ago
Dmitry Stogov wrote:
> Hi, > > Because of some confused people I reverted "break label" patch and post it > for discussion once again together with GOTO patch. > > Please reviw and vote. > > 1) goto and break label
+1
> 2) goto only (like C)
+1
> 3) break label only (like Java)
+1
> 4) nothing
-1 regards, Lukas

Marcus Börger

20 years ago
Hello Dmitry, Tuesday, March 7, 2006, 10:28:27 AM, you wrote:
> Hi,
> Because of some confused people I reverted "break label" patch and post it > for discussion once again together with GOTO patch.
> Please reviw and vote.
> 1) goto and break label
-1e307
> 2) goto only (like C)
-1e307
> 3) break label only (like Java)
given usable non confusing syntax i am ok
> 4) nothing
+1
> My vote: (1) +0.5, (4) +0.5
"If i want Spaghetti i cook some and don't brew unreadable and unmaintainable php code. And if i write a parser or scanner i use C and only C and nothing else. And besides the latter there is need for the concept goto." And well i am ignoring the rest of this :-) Best regards, Marcus

bertrand Gugger

20 years ago
Dmitry Stogov wrote:
> Hi, > > Because of some confused people I reverted "break label" patch and post it > for discussion once again together with GOTO patch. > > Please reviw and vote. > > 1) goto and break label > 2) goto only (like C) > 3) break label only (like Java) > 4) nothing > > My vote: (1) +0.5, (4) +0.5 > > Thanks. Dmitry. >
I'm not concerned by the vote. "break" should be consistant with "continue" so break labels could only be "like Java". if confused with "goto", what are labels then ? the case is very well shown by someone in the list, can't find the post back, as: etiquette: while (...) { ... break etiquette; // breaks loop, next after the } ... continue etiquette; // continues loop, next after the { ... goto etiquette; // breaks and restarts loop ... } I can see what the 3 do with respect to any vote conclusion here. Mixing "goto" with "break" and "continue" could bring confusion. Not necessarly if established that goto will break any loop up to the one where the target is. Assuming labels can also be applied to non "loop" constructs, then goto should break all loops up to the loop labeled by etiquette or containing etiquette on its direct level. Finally, I see goto as a nightmare, here. Last troll's note: goto has 2 "O" as Object Oriented
-- toggg

Steph

20 years ago
> I'm not concerned by the vote.
Please, Bertrand, the goto/labelled breaks discussions were held ad infinitum last June, and back in December, and again more recently. The _only_ concern now is the vote. Anything else will lead to so much noise on here we can't hear ourselves think, and since everyone who had anything to say on the matter already did so the first time(s) there won't even be any point to it. - Steph

bertrand Gugger

20 years ago
Steph Fox wrote:
>> I'm not concerned by the vote. > > > Please, Bertrand, the goto/labelled breaks discussions were held ad > infinitum last June, and back in December, and again more recently. The > _only_ concern now is the vote. Anything else will lead to so much noise > on here we can't hear ourselves think, and since everyone who had > anything to say on the matter already did so the first time(s) there > won't even be any point to it. > > - Steph
If I could vote:
> 1) goto and break label
-1
> 2) goto only (like C)
-0.5
> 3) break label only (like Java)
0
> 4) nothing
0.5 Please consider "break" and "continue" same in my vote 4) is positive as acting against 1) and 2) Regards
-- toggg

Steph

20 years ago
That's 'one man one vote' NOT 'one mail one vote' :) ----- Original Message ----- From: "bertrand Gugger" <toggg@php.net> To: <internals@lists.php.net>; "Steph Fox" <steph@zend.com> Cc: "Dmitry Stogov" <dmitry@zend.com> Sent: Wednesday, March 08, 2006 11:57 PM Subject: Re: [PHP-DEV] Re: GOTO and/or BREAK LABEL

bertrand Gugger

20 years ago
Dmitry Stogov wrote:
> Hi, > > Because of some confused people I reverted "break label" patch and post it > for discussion once again together with GOTO patch. > > Please reviw and vote. > > 1) goto and break label > 2) goto only (like C) > 3) break label only (like Java)
> 4) nothing > > My vote: (1) +0.5, (4) +0.5 > > Thanks. Dmitry. >
I'm not concerned by the vote. "break" should be consistant with "continue" so break labels could only be "like Java". if confused with "goto", what are labels then ? the case is very well shown by someone in the list, can't find the post back, as: etiquette: while (...) { ... break etiquette; // breaks loop, next after the } ... continue etiquette; // continues loop, next after the { ... goto etiquette; // breaks and restarts loop ... } I can see what the 3 do with respect to any vote conclusion here. Mixing "goto" with "break" and "continue" could bring confusion. Not necessarly if established that goto will break any loop up to the one where the target is. Assuming labels can also be applied to non "loop" constructs, then goto should break all loops up to the loop labeled by etiquette or containing etiquette on its direct level. Finally, I see goto as a nightmare, here. Last troll's note: goto has 2 "O" as Object Oriented
-- toggg