Re: Re: Character mangling test
Re: Re: Character mangling test
- Subject: Re: Re: Character mangling test
- From: email@hidden
- Date: Sun, 18 Feb 2001 21:28:11 EST
In a message dated 2/18/01 6:25:16 PM, Arthur J Knapp wrote:
>
So we use expressions like "is greater than or equal to", perhaps
>
in combination with a whose clause, AND we keep lines short. ;-)
>
>
tell application "Finder"
>
>
set nameList to name of every file of myFolder whose physical size
>
of it is greater than or equal to 3200
>
>
end tell
Exactly! : )
How about
tell application "Finder"
set myFolder to folder "HardDrive:whatever"
get name of files of myFolder whose physical size > 3199
set nameList to the result
end tell
Shorter lines clarify logic.
Shorter lines are almost always possible.
Shorter lines make editing easier.
Shorter lines make code more modularizable.
Inability to create short lines reflects
1) fuzzy logic, or...
2) lack of creativity.
The wordy comparison operators are almost always workaroundable.
If you must shorten lines that have the wordy phrases...
if x is less than or equal to y
becomes
if y > x
and
if x is not equal to y
becomes
if x = y then
-- do anything
else
-- do what you wanted to do if x and y are unequal
end if
Note that I would suggest doing this *only* if it is necessary for avoiding
line wrap. My original point (which I lost somewhere) was that adjusting
scripting style can obviate almost all of the evil server mangles we have
seen.
Out of curiosity, do any mail servers protect line wrap, or is it just that
the continuation character [option-L] (OK, I concede) is high ASCII?
Now here's a challenge: Excluding the chevrons and omega character, and
excluding ridiculously long variable names, can anyone produce a script that
cannot be reduced to a 100 % email friendly form? Send me your obfuscripts
(15 lines max) and I'll try the first five. I maintain the server problem is
fixable by posting mangle-proof scripts in the first place.
Jeff Baumann
email@hidden
www.linkedresources.com
11 Days, 3 Hours, 59 Minutes
How is it going to end?
Friends don't let friends email high ASCII.