Arrays vs Lists
David Vaughan
dvk at dvkconsult.com.au
Wed Dec 4 14:27:01 EST 2002
On Thursday, December 5, 2002, at 12:32 AM, Mike McManus wrote:
> I have seen a lot about arrays lately here. So I am wondering.
>
> 1. Why or when is an Array better than a list?
> 2. When is a multidimensional Array better than a variable made up of
> multiple lines with a list on each line?
>
Mike
Reflecting on my practice, my approach is that I use an array when I
wish to access elements at random or think of information as labelled
data, whereas a list is preferred whenever I have a data blob or
naturally deal with it in sequence. These are not exclusive, as you can
refer to line n of a list (slow compared with an array), combine an
array and treat as a list for a while, or sort its keys for a
particular sequence.
Since all keys in Rev arrays are just extended strings, with the
multi-key structure being one of our imagining, I used two-dimensional
lists (lines of items) rather than two-key arrays in the most obvious
example in my recollection. Both lists and arrays can have delimiter
problems (between the keys in multi-dimensional arrays) depending on
the data.
regards
David
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
More information about the use-livecode
mailing list