MACSCRPT Archives

May 2003

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Nigel Garvey <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Fri, 23 May 2003 11:51:20 +0100
Content-Type:
text/plain
Parts/Attachments:
text/plain (30 lines)
Joe Barwell wrote on Thu, 22 May 2003 23:24:28 +1300:

>On Thu, 22 May 2003, Nigel Garvey
><[log in to unmask]> wrote:
>
>>There are two later optimisations of the last line. Richard Hartman's:
>>
>>  set monthNum to 1 + (theDate - b) div 2500000
>>
>>... and mine:
>>
>>  set monthNum to (theDate - b + 3944592) div 2629728
>
>It took me a while to see their point, but is their "advantage"
>actually measurable?  I suppose with a g3/g4 running a zillion
>iterations one might notice something...

Well, true. Even on slower machines, you could write almost any old junk
here - provided that the right answer came out at the other end - and the
user would be none the wiser. But to scripters who find Emmanuel's
solution interesting, elegant, satisfying, and admirable, the two
optimisations would also be of interest. Hence my mention of them.

>2 groszy

[Manfully resists the temptation to get sidetracked into a discussion of
some very interesting Polish number grammar. :-)]

NG

ATOM RSS1 RSS2