Actually, the equivalent I meant was the example someone posted
of "do { f(); break; g(); } while (0)". I believe the "goto"
being discussed is a "local" goto, so just about anything you could
do with it can be done today with some sort of ugly while/do/for
sort of structure. Someone who would use "goto" poorly is a
strong candidate for making a difficult to read loop. Perhaps
it would be better to read a "goto" in their code than have to
figure out why they have that odd loop construct...
- Todd
On Fri, 2004-07-30 at 11:48, Zeev Suraski wrote:
> At 21:37 30/07/2004, Todd Ruth wrote:
> >Something doesn't quite seem right to me about a position
> >that has both of the following assertions:
> >1) goto should not be available
> >2) there's already an equivalent of goto available, so
> > goto is not needed (and it's just fine that people
> > use the equivalent)
> >
> >If you really believe "1", shouldn't you be arguing for
> >some sort of a warning if someone uses "2"?
>
> You have a point, but it's not that strong. It's much more difficult to
> abuse exceptions, both because of their interface which only suits error
> handling (you'd find it difficult to implement loops with exceptions, for
> instance), because you have to learn how to use them from docs (you won't
> be able to guess you way around it like you could with GOTO), and because
> of the name that doesn't leave any room for mistakes, that it's designed
> for handling error situations.
>
> Zeev
>
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php