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;   }
pike.git/lib/modules/Array.pmod:245:    tmp=arr;    arr=bar;    bar=tmp;    }       return arr;   }      //! Get multiple columns from an array.   //! - //! This function is equvivalent to + //! This function is equivalent to   //! @pre{   //! map(ind, lambda(mixed i) { return column(x, i); })   //! @}   //!   //! @seealso   //! @[column()]   array(array) columns(array x, array ind)   {    array(array) ret=allocate(sizeof(ind));    for(int e=0;e<sizeof(ind);e++) ret[e]=column(x,ind[e]);