Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61798 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92261 invoked from network); 25 Jul 2012 23:49:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Jul 2012 23:49:30 -0000 Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lerdorf.com from 209.85.161.170 cause and error) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 209.85.161.170 mail-gg0-f170.google.com Received: from [209.85.161.170] ([209.85.161.170:51276] helo=mail-gg0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 53/33-08189-90680105 for ; Wed, 25 Jul 2012 19:49:30 -0400 Received: by ggnf2 with SMTP id f2so1618829ggn.29 for ; Wed, 25 Jul 2012 16:49:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding:x-gm-message-state; bh=v55UQMpExfnsZUb4CHXOhlJeTAF5R/I7+gNH7zFIkcU=; b=f5HC8B38Y384QvSW7mVCS3dEiGCharLGBSzr0ucpkJFinmOpsynVe7U0/vHXjH8Wno tUfiT8CIePsKGPyc/2mPikv5Tyal7zeCQg4vlZ7dn4QfJ679uzI8tuoUVOTZU/2+1mFY z2suiPgSSnezqLuSWeSqGQuw3MelL3Un6yp1dqim6T92mgxb+96CHP5YxsZxeGb8d8Hq g8L5Rk8q/d5KYUHf+1t3CsP7mStmxpr3BkNGymBywI7mNIT+tywQJ5fyv3Q6fjEoNU0e K1wxaFW40oBFuI/2afVLN+QUmC5KOaAUEuCH5kgh3Qwb7oHE0YeAs7D3otCa3GKWUClU n4RA== Received: by 10.66.75.97 with SMTP id b1mr16237235paw.15.1343260166703; Wed, 25 Jul 2012 16:49:26 -0700 (PDT) Received: from [192.168.200.5] (c-50-131-40-116.hsd1.ca.comcast.net. [50.131.40.116]) by mx.google.com with ESMTPS id qd2sm11675048pbb.29.2012.07.25.16.49.21 (version=SSLv3 cipher=OTHER); Wed, 25 Jul 2012 16:49:25 -0700 (PDT) Message-ID: <501085FE.7070406@lerdorf.com> Date: Wed, 25 Jul 2012 16:49:18 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: Alex Aulbach CC: Sara Golemon , Andrew Faulds , Ferenc Kovacs , Sherif Ramadan , internals@lists.php.net References: <500EE3B9.8010902@ajf.me> <500EEA76.1030407@ajf.me> <5010138D.5050804@ajf.me> <501015B9.6050704@ajf.me> In-Reply-To: X-Enigmail-Version: 1.5a1pre Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQnYuHgfsnnRovAJEyFZujNNJF5v+dtPTaB19Ohchf3Mh4CelLN+6XO+uf6HwFYfsQHL3swe Subject: Re: [PHP-DEV] Re: Generators in PHP From: rasmus@lerdorf.com (Rasmus Lerdorf) On 07/25/2012 04:25 PM, Alex Aulbach wrote: > In 50 lines of code yield will be just overseen. > > But I meant something different: I thought of documentation. Maybe > someone reads the docs. Really! In the docs he will find functions. > And in the function this "yield". He dosn't want to know that. It > makes stress. "Why do I need to know how yield functions work, I > barely understand functions." > So this is systematically wrong. Right would be, that yield is an own > chapter. Will be easier if a generator is not a function. I'm with Sara on this one. A generator is enough like a function that we don't need a new keyword for it. We typically don't get too pedantic in PHP concepts and try to keep things simple. What we call an array isn't technically an array either. It's an ordered map, but it looks enough like an array that it is simpler to just call it that. And objects technically have methods or member functions, not functions, but we don't have a method/member keyword either. -Rasmus