Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61707 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 61601 invoked from network); 24 Jul 2012 17:42:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Jul 2012 17:42:09 -0000 Authentication-Results: pb1.pair.com header.from=g.b.yahav@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=g.b.yahav@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.182 as permitted sender) X-PHP-List-Original-Sender: g.b.yahav@gmail.com X-Host-Fingerprint: 209.85.212.182 mail-wi0-f182.google.com Received: from [209.85.212.182] ([209.85.212.182:41901] helo=mail-wi0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 02/34-42538-F6EDE005 for ; Tue, 24 Jul 2012 13:42:08 -0400 Received: by wibhq12 with SMTP id hq12so3469714wib.11 for ; Tue, 24 Jul 2012 10:42:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=DT0g0dtwF4uhoUxOswTdGjatb5KOjiJ+r/G2Gk5oX5o=; b=yQgyovklNSGffwdMra2EQgjJKMxiA2k6kp6EFyxeBVhpBxjoacG59BqSJ+426dOq9X RxEKG82O7A7tQmc29zVz/wAHX3tTFtH23Uu1r3GDHcjlMmycNDDzLXFkCDFKg7uMm1dM KC7vsOkVbUDIBPrmTwDnY09rujqGdYhfxWaqL7cRBI6wukbpqEuEkoAGc4638gmkC9s1 jfZ3671BgFEn4dGKZpLpMfAhDvNDbJmPvZlVSgEF59wVAI0PzJJDE0tseaaADJJDY9rw 081ekA88Z0FBTtbUQaV5VJk1LyM7BEKse5+beDb/wmOC685VDCgUKY8SrPELhHkcuvIX T65A== Received: by 10.180.106.137 with SMTP id gu9mr8857492wib.20.1343151725277; Tue, 24 Jul 2012 10:42:05 -0700 (PDT) Received: from [10.0.0.3] ([109.64.148.5]) by mx.google.com with ESMTPS id cl8sm5314062wib.10.2012.07.24.10.42.03 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 Jul 2012 10:42:04 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=utf-8 In-Reply-To: <500EDCC7.1020402@ajf.me> Date: Tue, 24 Jul 2012 20:42:02 +0300 Cc: internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: References: <500EDCC7.1020402@ajf.me> To: Andrew Faulds X-Mailer: Apple Mail (2.1278) Subject: Re: [PHP-DEV] Re: Generators in PHP From: g.b.yahav@gmail.com (Yahav Gindi Bar) On 24 =D7=91=D7=99=D7=95=D7=9C 2012, at 20:35, Andrew Faulds wrote: > On 24/07/12 18:34, Alex Aulbach wrote: >> 2012/7/23 Sara Golemon : >>> Curious if you could expand on that. Generators are iterators, so = not sure >>> what you're asking for. >> It's the point which is unlogical for me. Maybe it's a question. If >> the generator is an object with the implementation of an iterator, = why >> do we need to have it as _function_? >>=20 > Much easier to make an iterator with a function than as a class. >=20 > --=20 > Andrew Faulds > http://ajf.me/ >=20 >=20 > --=20 > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >=20 I agree, implementing a class only for iterator may be pain sometimes, = and functions is much better - especially when 5.3 got the anonymous = functions, so we can even use the generators for iterator functions in = class methods which can be great.=