Re: Sifting a list sans loop
Re: Sifting a list sans loop
- Subject: Re: Sifting a list sans loop
- From: Victor Yee <email@hidden>
- Date: Sat, 26 Jan 2002 22:51:52 -0500
On Sat, 26 Jan 2002 20:43:13 -0600, ehsan saffari wrote,
>
I have many lists of 2000-5000 items.
>
In each list each item is either a list or a string.
>
I need to discard the lists and keep the strings for further processing.
>
Is there a method (osax included) that would allow me to discard the list
>
items without using a loop:
You could try asking for the "plain text" of the list. I'm not sure how stable
that would be on large lists, but it works fine with small lists.
set theList to {1, 1, {"2"}, "3", true, {4}, "3", 1}
plain text of theList
--> {"3", "3"}
Also works with other classes:
lists of theList
--> {{"2"}, {4}}
numbers of theList
--> {1, 1, 1}
booleans of theList
--> {true}
Victor