Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:59330 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 12158 invoked from network); 2 Apr 2012 21:34:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Apr 2012 21:34:09 -0000 Authentication-Results: pb1.pair.com header.from=ircmaxell@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ircmaxell@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.46 as permitted sender) X-PHP-List-Original-Sender: ircmaxell@gmail.com X-Host-Fingerprint: 209.85.216.46 mail-qa0-f46.google.com Received: from [209.85.216.46] ([209.85.216.46:55441] helo=mail-qa0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F8/9B-43049-F4B1A7F4 for ; Mon, 02 Apr 2012 17:34:08 -0400 Received: by qatm19 with SMTP id m19so2349371qat.12 for ; Mon, 02 Apr 2012 14:34:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=HTZwO4SyLLW4+6dWQAp4ii2z/ybNufxA6SAmzzYNKgE=; b=l6mAq+IP2xgl1MP6TdENX5HtUwymIZZI9hO9aN359vDrv7T/BmaIZmvdm0g9wlcc47 /+Hw0hCplBpce5bvQGTHJl1PNmX5nML9FknVfBlzk7yr1tgcJ1Qrjt5qiMNMK6f3BcNP R7RnOnd2+DRW5A7TDg/RS6dp/108QKck35c3DW9UICTqnTXnqsHQUt0TBaEUHEPJC7i1 W77DnN5LtZQ2u6YNb9sHFXsm7bNs2TizmfkgZjmBaGIDsZc2p+LiUYgRwDtVTj48JmRp 6WrSVZCJ4eShVL8CRNTcfYgvgs16nelcyZVcSDvN9tTiJzUw8NuJsll334VD1sCxmJkr +pNg== MIME-Version: 1.0 Received: by 10.224.207.135 with SMTP id fy7mr2672204qab.26.1333402444619; Mon, 02 Apr 2012 14:34:04 -0700 (PDT) Received: by 10.229.42.4 with HTTP; Mon, 2 Apr 2012 14:34:04 -0700 (PDT) In-Reply-To: References: Date: Mon, 2 Apr 2012 17:34:04 -0400 Message-ID: To: Samuel Giles Cc: Rasmus Schultz , internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] resume after exception From: ircmaxell@gmail.com (Anthony Ferrara) Sam, I'm not saying it's a good idea, but this would allow for pythonic style generators. http://wiki.python.org/moin/Generators Just pointing out one potential use-case... Anthony On Mon, Apr 2, 2012 at 4:35 PM, Samuel Giles wrote: > Hi Internals > > function test() >> { >> =A0echo "Begin Test!\n"; >> >> =A0throw new Interrupt(); >> >> =A0echo "Execution resumed!"; >> } >> >> try >> { >> =A0test(); >> } >> catch (Interrupt $e) >> { >> =A0echo "Execution interrupted.\n"; >> =A0resume; >> } >> >> The output of this would be: >> >> Begin Test! >> Execution interrupted. >> Execution resumed! >> > > My major concern would be, how does this* really* add to PHP? =A0Perhaps = I'm > missing the point, but what would this allow that can't be done in some > form using well defined "patterns", for lack of a better word. > > I'm not keen on the idea of throwing things such as Interrupts either, it > doesn't quite fit with their general use case. > > Sam