Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:59359 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 84006 invoked from network); 5 Apr 2012 23:47:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Apr 2012 23:47:44 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 67.192.241.173 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.173 smtp173.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.173] ([67.192.241.173:48325] helo=smtp173.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 73/F8-30259-E1F2E7F4 for ; Thu, 05 Apr 2012 19:47:43 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp7.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id 67A6D258549; Thu, 5 Apr 2012 19:47:40 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp7.relay.dfw1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 17BC22584BE; Thu, 5 Apr 2012 19:47:40 -0400 (EDT) Message-ID: <4F7E2F1B.2030109@sugarcrm.com> Date: Thu, 05 Apr 2012 16:47:39 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: Galen Wright-Watson CC: "internals@lists.php.net" References: <2FD77C3003DC4656BCF6309B097DD978@gmail.com> <4F7E1FB8.7020108@sugarcrm.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] resume after exception From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! >> While exceptions themselves may not be suitable for a general-purpose > control structure, they do embody one. It's an early-return mechanism that > you also see in some of the other control structures mentioned in this > thread (Python's generators, Common LISP's conditions). Even the "return" You can do the same generators do using iterators in PHP. You'll have to store state a bit more explicitly, but otherwise it'd be pretty much the same, as far as I can see. However, in general, thinking about more complex flow control structures in fine. Just there's no reason to get exceptions mixed into it. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227