Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_compile.c zend_compile.h zend_globals.h zend_language_parser.y /tests break_label01.phpt
break_label02.phpt break_label03.phpt break_label04.phpt break_label05.phpt break_label06.phpt brea
From: Rasmus Lerdorf Date: Sat, 04 Mar 2006 00:31:42 +0000 Subject: Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_compile.c zend_compile.h zend_globals.h zend_language_parser.y /tests break_label01.phpt
break_label02.phpt break_label03.phpt break_label04.phpt break_label05.phpt break_label06.phpt breaReferences: 1 2 3 4 5 6 Groups: php.zend-engine.cvs Request: Send a blank email to [email protected] to get a copy of this message
I really don't think labelled breaks at this point is worth this confusion. If this is going to happen, it should be goto-like. Something like this: while() {my_while: ... foreach() { ... break my_while; }} But then we are back to the all-out goto since you should be able to place the labels anywhere you want as long as you are not breaking into a deeper construct and only out of them, either forwards or backwards. And we don't seem to be able to agree on that. And I just re-read your point b) there and see that you said exactly the same thing, so yes, I agree with you. Did the goto patch let you use the label on a break as well? -Rasmus Andi Gutmans wrote:The supposed idea behind this syntax was that it was "clearer" than writing something like "break 2;". As you might have noticed I was not a huge supporter of this to begin with. And I think you make a good point that it not only isn't clearer but it's actually more confusing now. Adding a new weird syntax like :label and then later having label: for a goto-like syntax will be even more confusing. My suggestion: a) Forget about labeled break/continue and roll it back- We can survive without it. b) Commit a patch which we have already written for goto/jump which works backwards and forwards, except of course, you can't jump into loops/switches (which makes sense). Thoughts? Andi At 02:49 PM 3/3/2006, Rasmus Lerdorf wrote:Andi Gutmans wrote:At 10:29 AM 3/3/2006, Rasmus Lerdorf wrote:The confusion is that label: infers that execution ends up at this label somehow. Doesn't really matter how, but our syntax has it roots in C so if we are going to use a common C notation for something, it should behave in a somewhat similar fashion. If we want some notation for naming a specific loop (which I personally don't think is worth the core change) then couldn't we come up with a different notation? Heck, even flipping the colon to the other side a-la named SQL parameters would give people a visual cue that it isn't like a C label. :label while {Marcus Boerger wrote:Sorry, I don't get it. Why do we expect this to be an endless loop? break Label just says what loop to break out of. Or am I misunderstanding the concern?Hello Dmitry, the code is the opposite of our beloved KISS approach. When i read: Label: while(1) { break Label; } i clearly expect an endless loop, guess why?I'd have to agree with Marcus on this one. We are making one of the first forward compatibility breaks in the procedural language for this?... continue :label;} -Rasmus -- Zend Engine CVS Mailing List (http://cvs.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Thread (28 messages)
- Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_compile.c zend_compile.h zend_globals.h zend_language_parser.y /tests break_label01.phpt
break_label02.phpt break_label03.phpt break_label04.phpt break_label05.phpt break_label06.phpt break_label07.phpt break_label08.inc break_label08.phpt
break_label09.phpt php-src NEWS
- Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_compile.c zend_compile.hzend_globals.h zend_language_parser.y /tests break_label01.phpt
break_label02.phptbreak_label03.phpt break_label04.phpt break_label05.phpt break_label06.phptbreak_label07.phpt break_label08.inc break_label08.phpt
break_label09.phptphp-src NEWS
- Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_compile.czend_compile.h zend_globals.h zend_language_parser.y /testsbreak_label01.phpt
break_label02.phpt break_label03.phptbreak_label04.phpt break_label05.phpt break_label06.phpt break_l
- Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_compile.c zend_compile.h zend_globals.h zend_language_parser.y /tests break_label01.phpt
break_label02.phpt break_label03.phpt break_label04.phpt break_label05.phpt break_label06.phpt break_l- Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_compile.c zend_compile.hzend_globals.h zend_language_parser.y /tests break_label01.phpt
break_label02.phptbreak_label03.phpt break_label04.phpt break_label05.phpt break_label06.phptbreak_l
- Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_compile.c zend_compile.h zend_globals.h zend_language_parser.y /tests break_label01.phpt
break_label02.phpt break_label03.phpt break_label04.phpt break_label05.phpt break_label06.phpt brea
- Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_compile.c zend_compile.hzend_globals.h zend_language_parser.y /tests break_label01.phpt
break_label02.phptbreak_label03.phpt break_label04.phpt break_label05.phpt break_label06.phptbrea
- Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_compile.c zend_compile.h zend_globals.h zend_language_parser.y /tests break_label01.phpt
break_label02.phpt break_label03.phpt break_label04.phpt break_label05.phpt break_label06.phpt
- Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_compile.c zend_compile.hzend_globals.h zend_language_parser.y /tests
break_label01.phptbreak_label02.phpt break_label03.phpt break_label04.phpt break_label05.phptbreak_label06.phpt- Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_compile.c zend_compile.h zend_globals.h zend_language_parser.y /tests break_label01.phpt
break_label02.phpt break_label03.phpt break_label04.phpt break_label05.phpt break_label06.phpt- Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_compile.c zend_compile.hzend_globals.h zend_language_parser.y /tests break_label01.phpt
break_label02.phptbreak_label03.phpt break_label04.phpt break_label05.phpt break_label06.phpt
- RE: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_compile.c zend_compile.hzend_globals.h zend_language_parser.y /tests break_label01.phpt
break_label02.phptbreak_label03.phpt break_label04.phpt break_label05.phpt break_label06.phpt
- Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_compile.c zend_compile.hzend_globals.h zend_language_parser.y /tests break_label01.phpt
break_label02.phptbreak_label03.phpt break_label04.phpt break_label05.phpt break_label06.phpt
- RE: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_compile.c zend_compile.hzend_globals.h zend_language_parser.y /tests break_label01.phpt
break_label02.phptbreak_label03.phpt break_label04.phpt break_label05.phpt break_label06.phpt
- RE: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_compile.czend_compile.hzend_globals.h zend_language_parser.y /tests
break_label01.phptbreak_label02.phptbreak_label03.phpt break_label04.phpt break_label05.phptbreak_label06.phpt
- RE: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_compile.c zend_compile.hzend_globals.h zend_language_parser.y /tests break_label01.phpt
break_label02.phptbreak_label03.phpt break_label04.phpt break_label05.phpt break_label06.phpt- Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_compile.c zend_compile.hzend_globals.h zend_language_parser.y /tests break_label01.phpt
break_label02.phptbreak_label03.phpt break_label04.phpt break_label05.phpt break_label06.phpt- Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_compile.c zend_compile.hzend_globals.h zend_language_parser.y /tests
break_label01.phptbreak_label02.phpt break_label03.phpt break_label04.phpt break_label05.phptbreak_label06.phpt brea- Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_compile.c zend_compile.hzend_globals.h zend_language_parser.y /tests
break_label01.phptbreak_label02.phpt break_label03.phpt break_label04.phpt break_label05.phptbreak_label06.phpt break_l- Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_compile.c zend_compile.hzend_globals.h zend_language_parser.y /tests break_label01.phpt
break_label02.phptbreak_label03.phpt break_label04.phpt break_label05.phpt break_label06.phptbreak_label07.phpt break_label08.inc break_label08.phpt
break_label09.phptphp-src NEWS
« previous | php.zend-engine.cvs (#4657) | next » |
---|