Re: When is "z" != "z" ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At 1:10 PM -0400 6/5/06, Robert Cummings wrote:
>NOOOOO! More must be said!!
>
>a   <= z
>b   <= z
>c   <= z
>-snip-
>yx  <= z
>yy  <= z
>yz  <= z
>za   > z
>
>SOOOOOOOOOOOOOOOOooooooooooo, the comparisons stop before we get to aaa
>and so aaa is never reached. za is the last comparison to occur at which
>point the test fails and the loop stops.
>
>Cheers,
>Rob.


Rob:

Okay, I tried to get out of it, but I guess more must be said.

I do understand why the loop stops -- I totally understand the mechanics. After all this, how could I not? Besides, it's really not that difficult, is it? So, what might you guess I'm really talking about?

You see, what is failing to be understood here is what I'm addressing, which is basic set theory. One of the basic foundations for mathematics

If I have a set that is defined as all elements > "whatever" and < "something else", then you can address the set. You can ask questions about the set, such as what's the population of the set -- besides itself, does the set have any subsets, and such -- get the idea?

Now, if you have a set [A] where all elements within are defined as ("a" or greater) and (less than "z") -- then, believe or not, that set is infinite -- as is the set for everything > "z".

If you choose, which is the case here, to consider only a subset of [A], then that's fine -- but understand that when you say the sequence is --

a b c ... x y z aa ab ac ... yx yy yz za zb zc ... zy zx zz aaa aab

-- it's not!

But rather, the actual sequence is:

a b c ... x y z aa ab ac ... yx yy yz aaa aab aac... <infinite> z

You simply have chosen to arbitrarily end the sequence at "yz". That's the reason why "aaa" is less than "z" but not included in the "php-loop" set of (for i=a to z).

You can't say that "a" and "aaa" are members of a set identified as < "z" and then step through all the members of that population (an infinite group) and not include "aaa" -- UNLESS -- you arbitrarily determine an end point for a much smaller sub-set.

Now, unless, there is something that I don't see, which certainly could be the case, then php designers could have just as easily ended the loop at "z" and dispensed with this quirk all together.

Besides, what's the point of having 676 character between a and z? Is there one? I think the "accepted" number would be closer to 26, don't you think? It just seems more like common sense to me -- doesn't it to you?

But this is the way it is and I except that -- but as Dirty Harry once said "A man's got to know his limitations" -- this not only applies to men and programmers, but also for languages as well.

For example, the Unicode issue was raised during this discussion -- if php doesn't consider the numeric relationship of characters, then I see a big problem waiting in the wings. Because if we're having these types of discussions with just considering 00-7F characters, then I can only guess at what's going to happen when we start considering 000000-FFFFFF code-points.

Now, was that enough said?  :-)

Cheers.

tedd

-- 
------------------------------------------------------------------------------------
http://sperling.com  http://ancientstones.com  http://earthstones.com

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux