Re: Getting elements of a list
Re: Getting elements of a list
- Subject: Re: Getting elements of a list
- From: Stan Cleveland <email@hidden>
- Date: Wed, 16 Apr 2008 14:24:18 -0700
- Thread-topic: Getting elements of a list
On 4/16/08 1:24 PM, "Mark J. Reed" wrote:
> My main objection is that it requires you to know how many pairs there
> are. But it gives me another idea.. I'm walking to the car now and
> can't check, but would this work?
>
> repeat with {k, v} in myList
> set end of firstItems to k
> end repeat
Nope. That doesn't compile and won't work, but this will:
repeat with x in myList
set {k, v} to x
set end of firstITems to k
end repeat
So it is possible to process a list of lists of any length, but it requires
using a repeat loop, which defeats the whole point of destructuring.
I do agree with Ed: repeat loops are our friends!
Stan C.
_______________________________________________
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