• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Broken date math on AppleScript 2.0
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Broken date math on AppleScript 2.0 (From: Scott Babcock <email@hidden>)
 >Re: Broken date math on AppleScript 2.0 (From: deivy petrescu <email@hidden>)
 >Re: Broken date math on AppleScript 2.0 (From: "Mark J. Reed" <email@hidden>)
 >Re: Broken date math on AppleScript 2.0 (From: deivy petrescu <email@hidden>)
 >Re: Broken date math on AppleScript 2.0 (From: "Mark J. Reed" <email@hidden>)
 >Re: Broken date math on AppleScript 2.0 (From: Philip Aker <email@hidden>)
 >Re: Broken date math on AppleScript 2.0 (From: "Mark J. Reed" <email@hidden>)

  • Prev by Date: Re: Broken date math on AppleScript 2.0
  • Next by Date: Re: Broken date math on AppleScript 2.0
  • Previous by thread: Re: Broken date math on AppleScript 2.0
  • Next by thread: Re: Broken date math on AppleScript 2.0
  • Index(es):
    • Date
    • Thread