pike.git / lib / modules / Array.pmod

version» Context lines:

pike.git/lib/modules/Array.pmod:142:    for(e=0;e<sizeof(arr);e++)    if(([array(function(mixed...:mixed))]arr)[e](@args))    return e;    return -1;    }       error("Bad argument 2 to search_array().\n");   }      //! Applies the function @[sum] columnwise on the elements in the - //! provided arrays. E.g. @expr{sum_array(`+,a,b,c)@} does the same + //! provided arrays. E.g. @expr{sum_arrays(`+,a,b,c)@} does the same   //! as @expr{`+(a[*],b[*],c[*])@}.   array sum_arrays(function(int(0..0) ...:mixed) sum, array ... args)   {    // FIXME: int(0..0) in the function prototype above is a kludge.    // See the FIXME in sort_array.    array ret = allocate(sizeof(args[0]));    for(int e=0; e<sizeof(args[0]); e++)    ret[e] = sum( @column(args, e) );    return ret;   }