• 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: Thu, 21 Feb 2008 14:58:25 -0800

On 2008-02-20, at 08:04:42, Axel Luttgens wrote:

Le 20 févr. 08 à 16:11, Mark J. Reed a écrit :

Yes, there is a bug in date conversion.

The problem seems to be somewhat subtler...
It was already noted by Donald back in November:
http://lists.apple.com/archives/applescript-users/2007/Nov/ msg00511.html
and I couldn't even decide at that time whether it is by accident that real numbers came into the picture...
But one thing is sure: 10.5.2 hasn't addressed the issue. ;-)

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.

Right; moreover, the language's specification clearly states the fact.

Maybe that was good enough in 1992, but not anymore. And just because you two happen to think that unwarranted integer->float promotion is ok doesn't make it correct.


These days, XML rules. The bottom line is exact interchange with XML data-types. I'm sure the AppleScript team could fix it in a flash but the source of this problem is that CFNumber/NSNumber (OS X native number "classes") don't have unsigned types (nor OSTypes as a storage classification). This means that any coordination of AppleScript unsigned number types to the native number types entails a loss of information. Consequently, AppleScript is still _forced_ to waste 2 bits for the sign. That's not acceptable for matching up to the bottom line international standard. If you read through the links to CFDate I posted previously, you will have noted also how AppleScript is living in the past by still passing DateTimeRec in AppleEvents.


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
  • Follow-Ups:
    • Re: Broken date math on AppleScript 2.0
      • From: "Mark J. Reed" <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>)
 >Re: Broken date math on AppleScript 2.0 (From: Axel Luttgens <email@hidden>)

  • Prev by Date: Re: AppleScript-Users Digest, Vol 5, Issue 123
  • Next by Date: Re: write file to /Library/Preferences
  • 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