Newsgroups: php.i18n,php.internals Path: news.php.net Xref: news.php.net php.i18n:1021 php.internals:24208 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53009 invoked by uid 1010); 24 Jun 2006 17:24:38 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 52992 invoked from network); 24 Jun 2006 17:24:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Jun 2006 17:24:38 -0000 X-PHP-List-Original-Sender: andrei@gravitonic.com X-Host-Fingerprint: 204.11.219.139 lerdorf.com Linux 2.5 (sometimes 2.4) (4) Received: from ([204.11.219.139:35752] helo=lerdorf.com) by pb1.pair.com (ecelerity 2.1.1.3 r(11751M)) with ESMTP id 5B/AD-02438-2557D944 for ; Sat, 24 Jun 2006 13:24:35 -0400 Received: from [192.168.1.107] (ppp-71-139-61-196.dsl.snfc21.pacbell.net [71.139.61.196]) (authenticated bits=0) by lerdorf.com (8.13.7/8.13.7/Debian-1) with ESMTP id k5OHOVjQ000919; Sat, 24 Jun 2006 10:24:31 -0700 In-Reply-To: <19910612231.20060624113517@marcus-boerger.de> References: <23ead5a35bff30e24f93045de3db6638@gravitonic.com> <449C5A1A.3080407@php.net> <19910612231.20060624113517@marcus-boerger.de> Mime-Version: 1.0 (Apple Message framework v750) X-Priority: 3 (Normal) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-ID: <117C7253-125E-4DED-AB6C-E0AABEF621BC@gravitonic.com> Cc: Michael Wallner , php-i18n@lists.php.net, Content-Transfer-Encoding: 7bit Date: Sat, 24 Jun 2006 10:24:30 -0700 To: Marcus Boerger X-Mailer: Apple Mail (2.750) Subject: Re: [PHP-I18N] Re: [PHP-DEV] Re: TextIterator changes From: andrei@gravitonic.com (Andrei Zmievski) Thanks, I know what they are for. I remember discussing Iterator vs. Traversable with you on IRC, and for some reason we settled on Traversable. Anyway, I'm changing it now. -Andrei On Jun 24, 2006, at 2:35 AM, Marcus Boerger wrote: > 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