Re: Why is it
Re: Why is it
- Subject: Re: Why is it
- From: Doug McNutt <email@hidden>
- Date: Sat, 1 Jan 2005 09:59:47 -0700
At 19:46 -0800 12/31/04, Paul Berkowitz wrote:
>"December" > "November"
>--> false
>
>That proves that using ' > ' with month constants coerces them to integers,
>which is intelligent. Using ' > ' with strings just checks the ASCII number
>of the initial character.
Taking my tongue out of my cheek I remain shocked by the willingness of AppleScripters to accept a language that is so much like English that it includes the ability of lingual communication to cause misunderstandings.
"December" > "november"
--> false
"december" > "November"
--> false
Paul's statement is not always correct. I know it's a small deal and it probably won't matter much but code point n is greater than code point N. What's wrong is that Paul's comment is so typical of lax definitions in AppleScript itself. Experimentation indicates that it is sorting of the strings that produces the true or false. The sort is done in case-insensitive fashion [ probably toupper( ) but there is also strcmp( ) ]. The problem is that one has to learn by experiment and thus can never be sure. Sorting should depend on easy-to-find rules set for specific locales.
"10" > "2"
--> false
Even in OS neXt it's false but sorting file names under Finder will display "file10" after "file2". In this case Paul's statement appears to be correct. But is it complete? And will it remain so?
With tongue back in cheek, how about a base 7 number system in which the graphemes 0 through 6 represent the days? That way 1x would refer to day x in the following week. It would really help with those pill boxes that use "SMTWTFS" on top. And do those go "MTWTFSS" elsewhere in the world? What about avoiding offense to those who honor Friday as the Sabbath?
I'll be quiet now - promise.
Happy new year to all.
--
--> There are 10 kinds of people: those who understand binary, and those who don't <--
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden