Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60748 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 55141 invoked from network); 6 Jun 2012 02:28:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Jun 2012 02:28:11 -0000 Authentication-Results: pb1.pair.com header.from=laruence@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=laruence@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.42 as permitted sender) X-PHP-List-Original-Sender: laruence@gmail.com X-Host-Fingerprint: 209.85.212.42 mail-vb0-f42.google.com Received: from [209.85.212.42] ([209.85.212.42:33797] helo=mail-vb0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BA/72-46677-A30CECF4 for ; Tue, 05 Jun 2012 22:28:10 -0400 Received: by vbbfs19 with SMTP id fs19so4171201vbb.29 for ; Tue, 05 Jun 2012 19:28:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=+q2uF2zP7g3GwsImgPEWpIRcmNyf/XTQMhMDiN674EI=; b=n5M58z76EJD9yEt3uIcUvHP9iFxVeRC1Ztp2rBQCVNZOBcifoJ4DK0q84rsG1nlMyI qHlZcQ1qgAK9MhmhU70r+HQAHC95muFH0GwwPLJvCOQpfqXJEKf/PfT1DG6/I7nkejct U0u/wfG4QD6eM7bpO5UNS6r4oHV6Wu0rz3KEofPJ2wOeq6vnhACs+tgy3fxDfDV6mCs5 izD12zOuXwCGZ6cNp+meYkI1YP0l06dCdSkmzr+H2DcDP8/lm+TdKPu4l0c4/feLPWu3 TVZP8Z0cOaOPu2liUQqd6RwKxBgO3zeWRF3cUS+J7dH5fNXjY2x8NW+NNdNP/JltVp5d RlxQ== Received: by 10.52.155.193 with SMTP id vy1mr16456906vdb.123.1338949687476; Tue, 05 Jun 2012 19:28:07 -0700 (PDT) MIME-Version: 1.0 Sender: laruence@gmail.com Received: by 10.220.162.141 with HTTP; Tue, 5 Jun 2012 19:27:47 -0700 (PDT) In-Reply-To: References: Date: Wed, 6 Jun 2012 10:27:47 +0800 X-Google-Sender-Auth: Vd6L47vtvX4SafLCIyXLxISxNOk Message-ID: To: Nikita Popov Cc: PHP internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Generators in PHP From: laruence@php.net (Laruence) On Wed, Jun 6, 2012 at 10:15 AM, Laruence wrote: > Hi Nikita: > > =C2=A0 =C2=A0the most important part to me is how did you implemented `yi= eld` > keyword, =C2=A0 is there a whole patch file I can look into? Nervermind, I will check the branch out later thanks > > =C2=A0 =C2=A0what will happen if you use a `yield` in a normal function? > > =C2=A0 =C2=A0actually, =C2=A0I tried to implemented coroutine, but since = I could not > find a way to make zend_execute interruptable, then I didn't make it. > > =C2=A0 =C2=A0so, I am really interesting of this tech-specific :) > > thanks > > On Wed, Jun 6, 2012 at 1:35 AM, Nikita Popov = wrote: >> Hi internals! >> >> In the last few days I've created a proof of concept implementation >> for generators in PHP. It's not yet complete, but the basic >> functionality is there: >> https://github.com/nikic/php-src/tree/addGeneratorsSupport >> >> The implementation is outlined in the RFC-stub here: >> https://wiki.php.net/rfc/generators >> >> Before going any further I'd like to get some comments about what you >> think of adding generator support to PHP. >> >> If you don't know what generators are you should have a look at the >> "Introduction" section in the above RFC or in the Python documentation >> at http://wiki.python.org/moin/Generators. >> >> Nikita >> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php >> > > > > -- > Laruence =C2=A0Xinchen Hui > http://www.laruence.com/ --=20 Laruence =C2=A0Xinchen Hui http://www.laruence.com/