Arrays Ad Nauseam

Rob Cozens rcozens at pon.net
Sat Jul 17 09:51:59 EDT 2004


Hi All,

One I got started on arrays, I couldn't stop without mathematical 
capabilities; so array support in the next update of Serendipity 
Library will include arrayMath and matrixMath functions, as well as a 
newArray function for building & initializing arrays.  ArrayMath 
supports mathematical operations (+,-,*,/,div,mod,^) on each element 
of a numeric array using a single value as the second operand. 
MatrixMath supports the same operations, using the value of the 
corresponding element of a second array as the second operand.  The 
two arrays passed to matrixMath must have the same structure.

If anyone is currently doing "array math" using standard Transcript 
arrays, I would be interested in seeing how arrayMath & matrixMath 
compare in performance.   Both array math functions parse the source 
array via "repeat for each character...".  When any dimension 
delimiter character is encountered, the value of the preceding 
element is derived from the characters encountered since the last 
delimiter character.

If someone is interested in testing this before the next Library 
update, eMail me privately for copies of the handlers and a test 
stack.


Rob Cozens
CCW, Serendipity Software Company

"And I, which was two fooles, do so grow three;
Who are a little wise, the best fooles bee."

from "The Triple Foole" by John Donne (1572-1631)


More information about the use-livecode mailing list