Re: Broken date math on AppleScript 2.0
Re: Broken date math on AppleScript 2.0
- Subject: Re: Broken date math on AppleScript 2.0
- From: Philip Aker <email@hidden>
- Date: Wed, 20 Feb 2008 07:46:12 -0800
On 2008-02-20, at 07:11:41, Mark J. Reed wrote:
But that's no excuse for AppleScript's integer representation to
be ratty.
(rim shot)
You can always tell a good rock drummer because s/he'll pop the 12th
on a rim shot. This is not done by brute force, but rather the
precise placement of the tip WRT to the radius of the drum.
Yes, there is a bug in date conversion. But there's nothing wrong
with AS using 29-bit integers, especially since it automatically
(and mostly seamlessly) promotes to floating point as needed to
represent bigger numbers.
It's both wrong and confusing to represent an amount that can be
contained in a 32-bit int as a floating point. This should be
corrected because (signed) integers which are negative have the sign
contained in the value by definition.
Currently, an AppleEvent sends a LongDateRec parameter for dates.
It's history roughly parallels the deprecated functions in red:
<http://developer.apple.com/documentation/Carbon/Reference/
Date_Time_an_nt_Utilities/Reference/reference.html>
For current system date types, which are toll-free bridged (i.e. can
be used in C or Objective-C transparently) see:
<http://developer.apple.com/documentation/CoreFoundation/Conceptual/
CFDatesAndTimes/Concepts/DataReps.html>
Philip Aker
echo email@hidden@nl | tr a-z@. p-za-o.@
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden