Re: Why is it
Re: Why is it
- Subject: Re: Why is it
- From: Paul Berkowitz <email@hidden>
- Date: Fri, 31 Dec 2004 18:57:41 -0800
On 12/31/04 10:53 AM, "Michelle Steiner" <email@hidden> wrote:
> On Dec 31, 2004, at 11:37 AM, Paul Berkowitz wrote:
>
>> Month as integer is new in Panther (AppleScript 1.9.2). Weekday as
>> integer
>> has not been implemented (yet).
>
> I was subtly trying to ask why it has not been implemented yet. I
> guess that I was being too subtle.
In fact you didn't ask "Why has weekday coercion to integer not yet been
implemented when month to integer has?""
You asked
> November > June
> --> true
>
> But this is not legal:
>
> monday > tuesday
> --> "Can't make monday into a number, date, or text"
Your question was indeed so subtle that it was not entirely clear that you
realized that " > " operator made sense only for numbers here, implying an
automatic coercion to integer. I'm sure lots of readers here didn't realize
that.
I figured you probably did, but even so, I couldn't believe you were asking
the list members as to why weekday didn't also have an integer conversion,
since how would we know?
>
>> You don't really want the coercion of Monday to text to be automatic,
>> do
>> you?
>
> No, want the coercion of Monday to an integer to be automatic.
I think David's reply (" not all countries agree on what day is day 1"),
while true, is surely not the reason it hasn't been done. Apple would just
have to define which weekday they're using for day 1. Given that the
AppleScript weekday and month constants are happy about using the English
names throughout, I'd venture to guess Apple would probably adopt the US
format where Sunday is 1. The RFC for "iCal" format, which has a way of
encoding which day is the start of the week (e.g. "WKST= MO" for Monday) has
the default of Sunday and a default of Sunday for week start integer 1, as
Shane almost says.
The only reason for why weekday as integer has not yet been implemented is
surely that "They haven't got around to it yet". No one except an Apple
employee could confirm that definitely. Since you surely weren't expecting
that anyone else could answer definitely, the only way to interpret your
question was to assume that you didn't know that the " > operator implied
coercion as integer.
> On Dec 31, 2004, at 6:15 PM, David Durkee wrote:
>
>> Maybe its because not all countries agree on what day is day 1. I seem
>> to recall from French class that the French begin enumerating their
>> days from Monday while Americans start from Sunday.
>
> That can be handled in the International preferences, I would think.
> For that matter, iCal lets you choose the first day of the week, so
> it's not like it's never been done.
AppleScript _constants_ can't depend on user preferences. How would one
ever know what someone else meant? The AppleScript constant for "Monday" is
Monday, no matter what your regional settings. In fact, set your
International Prefs to French/France now, and try:
Monday as string
-->"Monday"
Not "lundi" (even if that might have been a better implementation). Very
different from
current date as string
--> "vendredi 31 décembre 2004 18:53:50"
So I expect that eventually we'll see:
Monday as integer
--> 2
If Chris feels like telling us exactly why that didn't happen for AS 1.9.2,
when month as integer was implemented, I'd be as interested as you to hear
about it. I don't suppose he's free to tell us if/when it _is_ likely to
appear.
--
Paul Berkowitz
_______________________________________________
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
References: | |
| >Re: Why is it (From: Michelle Steiner <email@hidden>) |