Instead of:

repeat with x = 1 to the number of items in myVar

... could have:

repeat with x in myVar by <delimiter>

Advantages:
- simpler syntax
- consistent with syntax of other new commands in 2.4 like split

Delimiters could be  comma|word|return
If myVar was an array you could have key|element as delimiters (specifying whether to 
iterate the keys or the values of each element)

Here's the new repeat construct for arrays (from 2.4 beta readme):

>A new modifier to the repeat keyword (for each element) can be used to
>simplify and improve performance of scripts.  For example, to loop
>over all the elements in an array variable named "a1", assigning
>variable tElement to each one in turn, use:
>repeat for each element tElement in a1

I think it would be more useful to be able to determine the key as well as it's value. 
 Instead of the above, why not:

repeat with x in myArray

... where x would be an array containing the key it's value as an array

x[key]
x[value]

This seems simpler and more flexible to me.

Comments?


-- 
--
Rodney Tamblyn
Educational Media group
Higher Education Development Centre, 75 Union Place
University of Otago, PO Box 56, Dunedin, New Zealand
ph +64 3 479 7580 Fax +64 3 479 8362
http://hedc.otago.ac.nz ~ http://rodney.weblogs.com


Archives: http://www.mail-archive.com/[email protected]/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.

Reply via email to