Please reviw and vote.
- goto and break label
- goto only (like C)
- break label only (like Java)
- nothing
- +0.25
- -1e38
- +1e38
- -infinity
Or, in other words, I want labelled break, and I don't want to have to emulate it with goto.
As a user who spent several days tracking down a subtle bug caused by a continue n that hadn't been altered to continue n+1, I regard labelled break as a vital addition -- for me, it's not the frequency with which it is used (very low, I agree), but the incredibly disproportionate maintenance burden (potentially extremely high). In my case, I was adding a level to a heavily nested looping/conditional structure (7 or 8 levels deep) extending over several hundred lines, and out of the few break/continue statements that needed adjusting I missed just one. If they had been labelled breaks, there would have been no maintenance problem, and I'd have had several more days on the next step.
If the "Java-like" syntax is seen as confusing, what about, as in some other languages, interpolating the label into the for/foreach/while statement:
for (....) label {...} or for label (...) {...}
This is clearly a different animal from a goto target label: (but should be in the same namespace, of course).
OK, I'll shut up now and slope off into a corner. (Perhaps I should design my own language whilst I'm there ... but nah, did that decades ago and got bored -- prefer higher-level programming these days!)
Cheers!
Mike
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS, LS6 3QS, United Kingdom
Email: m.ford@leedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm
If the "Java-like" syntax is seen as confusing, what about, as in some other languages, interpolating the label into the for/foreach/while statement:
for (....) label {...} or for label (...) {...}
a. label: for (....) { break label; } AND label: { for (....) {
break label; } } (see
http://www.rgagnon.com/javadetails/java-0500.html )
b. for (....) label { break label; }
c. for (....) { break label; } label:
ok, i was +1 for c, but +1 for b now.
only use "Java-like" syntax if "goto" will never be implemented
Please, Xuefer! Your vote was already recorded, shhh!
----- Original Message -----
From: "Xuefer" xuefer@gmail.com
To: "Ford, Mike" M.Ford@leedsmet.ac.uk
Cc: "Dmitry Stogov" dmitry@zend.com; internals@lists.php.net
Sent: Thursday, March 09, 2006 5:19 AM
Subject: Re: [PHP-DEV] GOTO and/or BREAK LABEL
If the "Java-like" syntax is seen as confusing, what about, as in some
other languages, interpolating the label into the for/foreach/while
statement:for (....) label {...} or for label (...) {...}
a. label: for (....) { break label; } AND label: { for (....) {
break label; } } (see
http://www.rgagnon.com/javadetails/java-0500.html )
b. for (....) label { break label; }
c. for (....) { break label; } label:
ok, i was +1 for c, but +1 for b now.only use "Java-like" syntax if "goto" will never be implemented
Please, Xuefer! Your vote was already recorded, shhh!
i wasn't to vote more than once. it's same vote but with a bit
different syntax changed. oh well, the result is out, this is only my
explaination.