Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61712 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68145 invoked from network); 24 Jul 2012 17:56:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Jul 2012 17:56:51 -0000 Authentication-Results: pb1.pair.com smtp.mail=alex.aulbach@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=alex.aulbach@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.170 as permitted sender) X-PHP-List-Original-Sender: alex.aulbach@gmail.com X-Host-Fingerprint: 209.85.213.170 mail-yx0-f170.google.com Received: from [209.85.213.170] ([209.85.213.170:53203] helo=mail-yx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A1/50-01267-2E1EE005 for ; Tue, 24 Jul 2012 13:56:50 -0400 Received: by yenl12 with SMTP id l12so7951804yen.29 for ; Tue, 24 Jul 2012 10:56:47 -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; bh=sIfGzRDdX1XQC2JhuZSp65yCXGJhXRN+yaAS4UdOE/U=; b=psCN4X1ULgVHLdMUBv6l/s2OcCCV4AV83PDs91cogygtjea7z7Fmr7w/fLdKndSvqP qnvH311B8c28wroXvZ/FStms/cTq/owI+cbOaSIzG3bPpLbusM6iAUZDkFz4vItuczRk 3A+albgLHNYF8dkbymtkpHxq21vAKZP1JCsuPneIAtw4+Xg/i+wxt5PUXNWb+nfBOE7B LZpzW7ozh033B08FxBHf5f5qQTDbhe9856B9s/d9u+QfbmYEMoFsAsZvworSTb7hTdcy ltNzyPbWXTf0bDvaU0eu5izxQKA2qcEQTNoZW3rD8DRJZAP8la5SFgGGKIJe8bifhvqU BUAQ== MIME-Version: 1.0 Received: by 10.66.75.201 with SMTP id e9mr6383107paw.54.1343152606983; Tue, 24 Jul 2012 10:56:46 -0700 (PDT) Received: by 10.68.31.7 with HTTP; Tue, 24 Jul 2012 10:56:46 -0700 (PDT) In-Reply-To: References: <500EDCC7.1020402@ajf.me> Date: Tue, 24 Jul 2012 19:56:46 +0200 Message-ID: To: Yahav Gindi Bar Cc: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] Re: Generators in PHP From: alex.aulbach@gmail.com (Alex Aulbach) 2012/7/24 Andrew Faulds : > Much easier to make an iterator with a function than as a class. 2012/7/24 Yahav Gindi Bar : > 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. Ok, why not call it "iterator" or "generator" or "huffpuff" instead of "function"? It's just the naming, which disturbs me, because a function is something which is, when called once finished once. I don't like mathematics, but that is one of the definition of a function: http://en.wikipedia.org/wiki/Function_%28mathematics%29 "each input is related to exactly one output" Couldn't be so complicated to introduce a new name for that, or? -- Alex Aulbach