Re: are finder items items? what is a vector?
Re: are finder items items? what is a vector?
- Subject: Re: are finder items items? what is a vector?
- From: Paul Berkowitz <email@hidden>
- Date: Sun, 27 Dec 2009 13:12:49 -0800
- Thread-topic: are finder items items? what is a vector?
On 12/23/09 3:05 PM, "email@hidden" <email@hidden> wrote:
> cfol is the raw code for folder. That it's displaying is (I think) part of
> the same bug that's confusing lists with vectors.
There's no confusion. A vector is a type of list. Back (*all* the way back)
in AppleScript 1.1, there were two types of list: linked lists and vectors,
which are directional lists. I think linked lists used to be written with
square brackets [], or maybe it's the other way around. Even today
{1,2,3} = [1,2,3]
--> true
I believe certain types of operations were quicker with linked lists, but
generally it wasn't too useful. Anyway, the distinction was removed shortly
after. But no one thought to change the word in the error message from
"vector" to "list". The error, as several others have said already, is that
both sides of the "is in" operator (short for "is contained by", as
mentioned) are supposed to be lists. This works:
1 is in {1,2,3}
because AppleScript has kindly supplied a silent (primitive) item to
single-item-list coercion. But unless the developers of an application have
implemented an application-item to -single-item-list coercion (and I haven't
yet run into any that bother to do so), you need the right 'list is in list'
syntax not to get that error about the application item (whatever it may
be) not being a vector (list).
--
Paul Berkowitz
_______________________________________________
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