Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:24206 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 75271 invoked by uid 1010); 24 Jun 2006 09:55:25 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 75256 invoked from network); 24 Jun 2006 09:55:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Jun 2006 09:55:25 -0000 X-PHP-List-Original-Sender: helly@php.net X-Host-Fingerprint: 81.169.182.136 ajaxatwork.net Linux 2.4/2.6 Received: from ([81.169.182.136:47769] helo=strato.aixcept.de) by pb1.pair.com (ecelerity 2.1.1.3 r(11751M)) with ESMTP id BE/12-02438-A570D944 for ; Sat, 24 Jun 2006 05:35:23 -0400 Received: from localhost (strato.aixcept.de [81.169.182.136]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by strato.aixcept.de (Postfix) with ESMTP id 4567B35C1CF; Sat, 24 Jun 2006 11:35:19 +0200 (CEST) Date: Sat, 24 Jun 2006 11:35:17 +0200 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <19910612231.20060624113517@marcus-boerger.de> To: Andrei Zmievski Cc: Michael Wallner , php-i18n@lists.php.net, In-Reply-To: References: <23ead5a35bff30e24f93045de3db6638@gravitonic.com> <449C5A1A.3080407@php.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-I18N] Re: [PHP-DEV] Re: TextIterator changes From: helly@php.net (Marcus Boerger) Hello Andrei, you should reconsider giving it full iterator interface. Adding more functionality is of course quite easy and no problem at all. Sharing an interface also makes the whole thing feel much better as in no conflicts as in consistent. Actually that's what interfaces are for. Friday, June 23, 2006, 11:20:28 PM, you wrote: > TextIterator does not implement Iterator interface, only Traversable. > It just happens to have functions of the same name as Iterator. > -Andrei > On Jun 23, 2006, at 2:16 PM, Michael Wallner wrote: >> Andrei Zmievski wrote: >>> I am working on implementing BreakIterator API [1]. I considered two >>> approaches: making a separate class or merging the API into the >>> existing TextIterator. Having a separate class would be a bit >>> cleaner, but I can see people wanting to use it in foreach(), and >>> since TextIterator already provides a lot of BreakIterator's >>> functionality, I decided that merging would be the best option. >>> However, there is an overlap between the BreakIterator API and the >>> current TextIterator one, so there will have to be some changes. >>> 1. TextIterator::current() signature will change from: >>> mixed current() >>> to: >>> mixed current(integer &$offset) >> >> This will raise the same issue as we have/had with the reflection API: >> mike@honeybadger:~/build/php-unicode-debug$ cli -r 'interface >> i{function f();} class c implements i{function f($a){}}' >> >> Fatal error: Declaration of c::f() must be compatible with that of >> i::f() in Command line code on line 1 >> >> >> Nah, don't look at me--I don't like that either. >> >> >>> 3. TextIterator::rewind() will be renamed to TextIterator::first() to >>> conform to BreakIterator's first()/last() API. >>> So this is heads up. Let me know if you have a problem with this. >> >> Huh? Rename or alias? It can't implement Iterator if there's no >> rewind() method. Best regards, Marcus