Making Revolution faster using dimensioned arrays
Ken Ray
kray at sonsothunder.com
Tue Jul 5 00:04:50 EDT 2005
On 7/4/05 9:33 PM, "Dennis Brown" <see3d at writeme.com> wrote:
> The advantage of such an arrangement is not only speed, but also
> compactness. If we are interested in speed it is likely that we have
> a large quantity of data. Arrays in Transcript today have a large
> overhead due to the key structure. Dimensioned arrays could easily
> take half the space or even less. The syntax could be very simple like:
>
> global myArray[1000,1000]=0 --numeric array
> local myArray[1000,1000,5]=false --Boolean array
> local myArray[1000]="" --empty character array
> local myArray[100,300]="abcd" --4 character word array
I really like this idea, Dennis, but I'm not sure I like the approach to
dimensioning, only because of Transcript's history of being able to
interpret things as strings, even if not quoted. So is:
local myArray[100,300]="false"
a boolean array, or a 5-character word array? Perhaps it's acceptable to be
more picky about this (i.e. the above would be a 5 character word array),
since we don't currently have a way of assigning a type, but I think there's
a better way. For example, using your approach, if you wanted a 25 character
word array, you'd have to provide a 25-character-long string.
It seems to me that the main thing is not the *type* of data, but for the
interpreter to know that there is a fixed size to array elements. So perhaps
something like:
local myArray[100,300] length 5
or something like that...
Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com
More information about the use-livecode
mailing list