pike.git / lib / modules / Array.pmod

version» Context lines:

pike.git/lib/modules/Array.pmod:117:   //! provided arrays. E.g. @tt{sum_array(`+,a,b,c)@} does the same   //! as @tt{`+(a[*],b[*],c[*])@}.   array sum_arrays(function(mixed ...:mixed) sum, array ... args)   {    array ret = allocate(sizeof(args[0]));    for(int e=0; e<sizeof(args[0]); e++)    ret[e] = sum( @column(args, e) );    return ret;   }    - //! This function sorts an array after a compare-function @[cmp] - //! which takes two arguments and should return @tt{1@} if the first argument - //! is larger then the second. + //! @decl array sort_array(array arr, function|void cmp, mixed ... args)   //! -  + //! This function sorts the array @[arr] after a compare-function + //! @[cmp] which takes two arguments and should return @tt{1@} if the + //! first argument is larger then the second. Returns the sorted array + //! - @[arr] is not sorted destructively. + //!   //! The remaining arguments @[args] will be sent as 3rd, 4th etc. argument   //! to @[cmp].   //!   //! If @[cmp] is omitted, @[`>()] is used instead.   //!   //! @seealso   //! @[map()], @[sort()], @[`>()], @[dwim_sort_func], @[lyskom_sort_func]   //!   array sort_array(array foo, function|void cmp, mixed ... args)   {