Re: Why the speed difference? (was: Problem with modification date of file...)
Re: Why the speed difference? (was: Problem with modification date of file...)
- Subject: Re: Why the speed difference? (was: Problem with modification date of file...)
- From: Mr Tea <email@hidden>
- Date: Thu, 14 Nov 2002 10:43:05 +0000
This from Andy Wylie - dated 14/11/02 7:59 am:
>
> set theFolder to alias [path to folder]
>
>
eh?
Perhaps I should have been more explicit, or used something that doesn't
compile. By using square brackets, I hoped to indicate that the phrase 'path
to folder' meant 'insert your own path to a folder that exists on your local
disks here'. This is fairly conventional usage (in the ASLG, square brackets
"indicate that the enclosed language element or elements are optional").
What would you prefer?
Anyway, why do square brackets compile? Do they have some specific AS
function? Are they used in some hideous code language that AS has been
forced to accommodate?
Script Editor seems to treat them as things to wrap lists in, and converts
them to the conventional braces in script results, but is sometimes confused
by them.
[1, 2, 3] & 4
--> {1, 2, 3, 4}
set end of [1, 2, 3] to 4
--> error: "Can't set end of {1, 2, 3} to 4
set l1 to {[1, 2, 3]}
set end of l1 to [4]
l1
--> {{1, 2, 3}, {4}}
It would be more straighforward (and would significantly extend the life
expectancy of my shift key) if square brackets just compiled as braces -
unless they are the vanguard of some sinister hidden agenda, in which case I
think we should be told.
Mr Tea
_______________________________________________
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.