Re: Rounding
Re: Rounding
- Subject: Re: Rounding
- From: has <email@hidden>
- Date: Sat, 23 Mar 2002 12:40:32 +0000
Arthur J Knapp wrote:
>
> on rndUpToX(n, x)
>
> tell n div x * x
>
> if it < n then return it + x
>
> it
>
> end tell
>
> end rndUpToX
>
>
;-)
>
>
You are the only scripter I know that can write code like this and
>
still have it be thought of as "easy to understand". :)
Don't laugh - he's got me doing the obfuscated tell block thing now. Agh!
It's infectious!
<sigh> At least I've not succumbed to the dreaded "Single-letter Variable
Names For Everything" disease. (Yet...)
>
Nigel has mentioned in the past that he does not like handlers that
>
consist of a single line of code.
Structural coding is a sign of Weakness. Real Men always use GOTOs.
>
It is fortunate for us that AppleScript
>
requires so many linebreaks to compile, otherwise Nigel's contributions
>
would all look like this:
>
>
tell n div x * x to if it < n then set r to it + x else set r to it
They do say that great programmers can write Assembly in any language...
Alas, AppleScript seems particularly determined to inflict at least a
modicum of order and readability on one's code. Still, even this can be
turned upon it to produce the following gem of crystal unclarity:
tell n div x * x to if it < n then
set r to it + x
else
set r to it
end if
Otherwise known as the 'How to Turn AppleScript's Pretty Printing Against
Itself Without Really Trying' Special. An indispensable weapon in the
Obfuscated AppleScripter's arsenal. Apply liberally, and stand well back as
you hit that Compile button.
has
--
http://www.barple.connectfree.co.uk/ -- The Little Page of Beta AppleScripts
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.