Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:8189 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 51692 invoked by uid 1010); 26 Feb 2004 21:25:22 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 51668 invoked from network); 26 Feb 2004 21:25:21 -0000 Received: from unknown (HELO shiva.mind.de) (212.42.230.204) by pb1.pair.com with SMTP; 26 Feb 2004 21:25:21 -0000 Received: from [192.168.1.105] (pD95F8104.dip.t-dialin.net [217.95.129.4]) by shiva.mind.de (Postfix) with ESMTP id A336997B59; Thu, 26 Feb 2004 22:25:15 +0100 (CET) Date: Thu, 26 Feb 2004 22:23:16 +0100 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <81374335265.20040226222316@marcus-boerger.de> To: Philip Fletcher Cc: internals@lists.php.net In-Reply-To: <20040226211355.32213.qmail@pb1.pair.com> References: <20040226160254.4324.qmail@pb1.pair.com> <1051368455281.20040226204516@marcus-boerger.de> <20040226200755.99362.qmail@pb1.pair.com> <20040226205225.87119.qmail@pb1.pair.com> <751373122906.20040226220304@marcus-boerger.de> <20040226211355.32213.qmail@pb1.pair.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Iterator Class/foreach Logic Flaw? From: helly@php.net (Marcus Boerger) Hello Philip, Thursday, February 26, 2004, 10:05:09 PM, you wrote: > Hi Marcus > Yes, the current implementation of hasMore() has an identical semantic to > isValid(). > The generally understood semantic of isValid() and hasMore() are quite > different - hence the need for the rename. As a side note: There is no generally understood hasMore(). Though there is isDone() and hasMore() is sometimes used/implemented as !isDone(). The main problem is that the original Iterator description everyone refers to doesn't have isValid() but instead only has isDone() which doesn't fit into for(;;). Reference: Gamma et Al, Design Patterns, 1994, Addison Wesley, p 257ff > Regards > Philip > Marcus Boerger wrote: >> Hello Philip, >> >> just to make it clear. hasMore() would be the exact same then isValid() >> only the name would change. The semantic is already what you refer to as >> isValid. >> -- Best regards, Marcus mailto:helly@php.net