Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:11638 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38383 invoked by uid 1010); 29 Jul 2004 23:03:48 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 36789 invoked from network); 29 Jul 2004 23:03:21 -0000 Received: from unknown (HELO iko.gotobg.net) (80.168.8.116) by pb1.pair.com with SMTP; 29 Jul 2004 23:03:21 -0000 Received: from pd9e61a6e.dip.t-dialin.net ([217.230.26.110] helo=[192.168.0.32]) by iko.gotobg.net with asmtp (Exim 4.34) id 1BqJvq-0006dI-F3 for internals@lists.php.net; Fri, 30 Jul 2004 02:03:27 +0300 Message-ID: <41099C4A.4080206@hristov.com> Date: Fri, 30 Jul 2004 00:54:34 +0000 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8a2) Gecko/20040627 X-Accept-Language: en-us, en MIME-Version: 1.0 CC: internals@lists.php.net References: <20040729021337.73894.qmail@pb1.pair.com> <1091136355.490.4.camel@localhost> <1091139076.29517.12.camel@blobule.suds> <410991E1.6070000@hristov.com> <1091140927.29516.18.camel@blobule.suds> <41099925.4020700@hristov.com> <20040729225322.94418.qmail@pb1.pair.com> In-Reply-To: <20040729225322.94418.qmail@pb1.pair.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - iko.gotobg.net X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - hristov.com X-Source: X-Source-Args: X-Source-Dir: Subject: Re: [PHP-DEV] GOTO operator From: php@hristov.com (Andrey Hristov) Sara Golemon wrote: >>do { >> .....code... >> if (something) break; >> ...code.... >>} while (0); >>...cleanup code... >> > > Are you suggesting a hack is better than the real thing? > > -Sara The "hack" is working. The manual says : " Advanced C users may be familiar with a different usage of the do..while loop, to allow stopping execution in the middle of code blocks, by encapsulating them with do..while (0), and using the break statement. The following code fragment demonstrates this:" (a similar code follows) " Don't worry if you don't understand this right away or at all. You can code scripts and even powerful scripts without using this 'feature'. " (the manual states that people can code powerful things without goto hack). Sara, if you need to have the goto, you know how to implement it with do..while. The average Joe may not need goto in some case but he will find that it simplifies his job (but making code clumsy, something what he does not realize). It is not because I don't like the power of goto, I would like not to be given in the hands of the newbie. andrey