sum_arrays

lpc4/lib/doc/efun/sum_arrays · 459 B

From the archive lpc4.05.14.tar.gz

Download the archive   « Back to the archive contents

NAME
	sum_arrays - map any number of arrays over a function.

SYNTAX
	mixed *sum_arrays(function fun,mixed *arr1,...);

DESCRIPTION
	Works like this:

        mixed *sum_arrays(function fun,mixed *arr1,...)
        {
          int e;
	  mixed *res=allocate(sizeof(arr1));
          for(e=0;e<sizeof(arr1);e++)
          {
	    res[e]=fun(arr1[e],arr2[e],...);
          }
	  return res;
        }

	Simple ehh?

SEE ALSO
	sum_mappings, map_array, filter_array

Site Stats

Snippets: 1791
Codebases: 571