Arrays: new and old keys, i

Mark Smith lists at futilism.com
Fri Sep 12 04:53:17 EDT 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[1]
.....
delete variable tBigArray[1]

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  
key.

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.

Best,

Mark

>
>
> 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:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list