Re: ranting about "as item"
Re: ranting about "as item"
- Subject: Re: ranting about "as item"
- From: Richard 23 <email@hidden>
- Date: Sun, 3 Dec 2000 09:05:30 -0800
>
That's right. And coercing something "as list as item" the way it
>
was written a few posts back in this thread was resulting in the "as
>
item" coercion doing precisely nothing.
I don't really know why you keep saying that over and over again.
Repetition doesn't makes something more true! 8)
{1, 2, 3} as item
--> {1, 2, 3}
{1} as item
--> 1
An Item is defined as an element of a list.
or more generally any item in a container.
when you have a single-item list, "as item" coerces the list to an item,
or more simply gets the element from the list.
when a applied to any value, an attempt is made to get the value contained
by that item. Here's another example.
--------------------
set dumList to words of "apple banana pear"
set theList to {a reference to dumList's 2nd item, "four", 10}
set {valueList, itemList, contentList} to {{}, {}, {}}
repeat with theValue in theList
set end of valueList to theValue
set end of itemList to theValue as item
set end of contentList to theValue's contents
end repeat
* * * * * * * * * * *
get valueList -- we know this is going to be messed up
--> {item 1 of {item 2 of {"apple", "banana", "pear"}, "four", 10},
item 2 of {item 2 of {"apple", "banana", "pear"}, "four", 10}, item 3 of
{item 2 of {"apple", "banana", "pear"}, "four", 10}}
get contentList -- this is a little better
--> {item 2 of {"apple", "banana", "pear"}, "four", 10}
get itemList -- here's the "as item" result
-->{"banana", "four", 10}
Yeah, "as item" isn't doing anything there either is it?
R23