Re: Re: Labeled Breaks (not the G-word)
| From: | Stanislav Malyshev | Date: | Tue, 29 Nov 2005 11:45: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-20814@lists.php.net to get a copy of this message | ||
LS>>discussions over the past months it seemed to me that the "goto all the way"
LS>>camp was fine with limiting jumping to the current scope (function/method)
That doesn't do much. That's like saying "access not to all memory but
only memory space of the process". Sure, you can't just jump random places
along all the code - but jumping random places inside same op-array is
not very good still.
LS>>which makes it much more obvious compared to exceptions in my book.
Exceptions allow passing control to specific well-defined points with
stack unwinding, etc. What this has to do with goto?
LS>>Eitherway its quite obvious that labeled breaks in loops are much easier to
LS>>read over "break 3" kinda stuff we require now. So even such a limited
That I agree. Labeled break seems to be a sane proposal, and does not
substantially differ from constant break as it is now, except that one
doesn't have to count levels manually.
LS>>"goto" aka "labeled break" construct is obviously needed quite dearly
LS>>and
But goto and labeled break is totally different. Labelled break is bound
to a control structure and is a part of it. goto is not.
--
Stanislav Malyshev, Zend Products Engineer
stas@zend.com http://www.zend.com/ +972-3-6139665 ext.115