Arrays: new and old keys, i
lists at futilism.com
Fri Sep 12 03:53:17 CDT 2008
One advantage is that dimensions of an array (ie. sub-arrays) can be
added and taken away in one simple line:
put someSubArray into tBigArray
delete variable tBigArray
avoiding the need to loop over the whole list of keys in order to
delete all elements with a particular value in an item of a compound
So in some cases, this is likely to make for code that is simpler
(less error-prone) and most likely more efficient when adding/
deleting mutliple elements to/from a large 'compound' array.
Then there is the whole question of hierarchical structures as
discussed so far.
We don't have much by way of data-structures in revolution, though I
myself have found that chunk expressions and the associative arrays
that we have make structuring data quite easy. But I welcome the new
arrays, because there are places in some of my code that will
definitely be simplified and clarified by their use.
Another enhancement that has come (though not dependent on multi-
dimensionality) is the promotion of arrays to 'first-class' values,
so we can use them in 'send' statements.
> Can anybody explain what the new array format provides that the old
> did not? All these bizarre examples seem not so much as
> exemplifying the ``new'' features as to leave me baffled as to what
> added value they provide. In NONE of the supposed or alleged
> examples have I seen anything I could not do with old arrays. So,
> and I mean in really simple language (not OOP-speak), wtf is up
> with these new arrays? I see nothing but extra brackets.
> Please avoid sending me Word or PowerPoint attachments.
> See <http://www.gnu.org/philosophy/no-word-attachments.html>
> -Dr. John R. Vokey
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
More information about the use-livecode