Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60747 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53508 invoked from network); 6 Jun 2012 02:15:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Jun 2012 02:15:39 -0000 Authentication-Results: pb1.pair.com smtp.mail=laruence@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=laruence@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.170 as permitted sender) X-PHP-List-Original-Sender: laruence@gmail.com X-Host-Fingerprint: 209.85.220.170 mail-vc0-f170.google.com Received: from [209.85.220.170] ([209.85.220.170:42999] helo=mail-vc0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 55/22-46677-A4DBECF4 for ; Tue, 05 Jun 2012 22:15:38 -0400 Received: by vcbfk1 with SMTP id fk1so4179366vcb.29 for ; Tue, 05 Jun 2012 19:15:36 -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=tYDFx1Xqflj6pqOc0IXEkKks4ZSuk9++cm4XM48lLLg=; b=jBb3FiLonL5zr3pxAvdG+fgFYGhI9dd+KnFiAy/Kn3RVTyrbNj4oLt05/3O8AYwhxF h2rGdnpt4j/L3zpeolvTaYAMrENTL5OZmX58sl1hr9jujN2n6K3kL8ND6UY+ISf8dcsy HNaBOlbCM5cCIikl2Pbh4dPBn74CtyM5gb+xbZeDuzAvAbcr/BZ49N6kKYAhaDtrsR67 MDu8fSiRHUWdo5X2fvRqndr6q/2llKGUeJwkRWwMliCoFhxuTGQKAKdpw67e++hmu6/+ DqR4yW0LQdV4+/JZNy1yrFwTQ4mvaIb7pMJYGRHr4R1hUuEPdx23mNyyPc0m7CZwEQ0m MGIQ== Received: by 10.52.88.176 with SMTP id bh16mr16393335vdb.132.1338948936010; Tue, 05 Jun 2012 19:15:36 -0700 (PDT) MIME-Version: 1.0 Sender: laruence@gmail.com Received: by 10.220.162.141 with HTTP; Tue, 5 Jun 2012 19:15:14 -0700 (PDT) In-Reply-To: References: Date: Wed, 6 Jun 2012 10:15:14 +0800 X-Google-Sender-Auth: 7TRqmUfmewGchw47kavMSN5oO7Y 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) Hi Nikita: the most important part to me is how did you implemented `yield` keyword, is there a whole patch file I can look into? what will happen if you use a `yield` in a normal function? actually, I tried to implemented coroutine, but since I could not find a way to make zend_execute interruptable, then I didn't make it. so, I am really interesting of this tech-specific :) thanks On Wed, Jun 6, 2012 at 1:35 AM, Nikita Popov wr= ote: > 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 > --=20 Laruence =C2=A0Xinchen Hui http://www.laruence.com/