On Tue, 2006-06-06 at 15:11, Martin Alterisio wrote:
> 2006/6/6, Robert Cummings <[EMAIL PROTECTED]>:
>
> > > You lost me there. Can you explain it a little bit further?
> >
> > You said:
> >
> >     "Still, an overload is an known issue and that can be caught
> >      easily."
> >
> > It follows that you need information about the overload to handle it.
> >
> > It is a known issue in PHP that incrementing 'z' by 1 produces 'aa'
> >
> > It follows that knowing that 'z' incremented by 1 produces 'aa' can be
> > caught easily.
> >
> > It follows that if it can be caught easily, it can be handled easily.
> >
> > Thus it finally follows your own words:
> >
> >     "as the issue is not considered a misuse but a normal function
> >      of the data type"
> >
> > Normal in PHP is exactly the behaviour that PHP deemed many years ago
> > for it to follow.
> >
> 
> Thanks, I got it now.
> 
> What I meant as "known issue" is that the program is notified of the
> occurrence of such problem. When the 'z' is incremented into 'aa' you're
> stepping back in the sequence order but nothing is said or notified in any
> way. The coder who explicitly wants to use such feature may handle the issue
> without a problem, but when you work on the basis that you can receive any
> kind of sequence, range, or iterator you can't know for sure that this
> happens. Consider this example:
> 
> function orderedSequence($start, $end) {
>     $orderedSequence = array();
>     for ($i = $start; $i <= $end; $i++) {
>         $orderedSequence[] = $i;
>     }
>     return $orderedSequence;
> }
> 
> Supposedly this function would return an ordered sequence of objects, which
> implement iteration, between $start and $end. Under the mentioned
> circumstances the function would fail to return an ordered sequence. Still,
> this kind of "generic" behaviour it something that isn't useful in PHP,
> since there isn't operator overloading. Anyway PHP5 has some features that
> point that generics will be used (correct if i'm wrong here, that's what I
> thought when I saw iterators in the SPL) and I think that we won't be able
> to use native operators to create proper iterators on strings with the
> current functionality assigned to them.
> 
> Well, my arguments are starting to sound much more like ranting that
> anything else. Sorry if they weren't appropiate.

No problem, doesn't really sound like ranting to me. But I think the
main problem some people are having is understanding that there are two
sequences in question here and not one. There is the sequence generated
by the incrementation operator, and there is the sequence of all
possible strings in their sorted order. Combining the semantics of the
two sequences does not necessarily leave you with the semantics of one
or the other.

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to