Skip to content
Snippets Groups Projects
Commit be192f39 authored by Marcus Comstedt's avatar Marcus Comstedt
Browse files

Renamed foldl/foldr to reduce/rreduce.

Rev: lib/modules/Array.pmod:1.38
parent 48be818d
No related branches found
No related tags found
No related merge requests found
...@@ -90,7 +90,7 @@ mixed filter(mixed arr, mixed fun, mixed ... args) ...@@ -90,7 +90,7 @@ mixed filter(mixed arr, mixed fun, mixed ... args)
} }
} }
mixed foldl(function fun, array arr, mixed|void zero) mixed reduce(function fun, array arr, mixed|void zero)
{ {
if(sizeof(arr)) if(sizeof(arr))
zero = arr[0]; zero = arr[0];
...@@ -99,7 +99,7 @@ mixed foldl(function fun, array arr, mixed|void zero) ...@@ -99,7 +99,7 @@ mixed foldl(function fun, array arr, mixed|void zero)
return zero; return zero;
} }
mixed foldr(function fun, array arr, mixed|void zero) mixed rreduce(function fun, array arr, mixed|void zero)
{ {
if(sizeof(arr)) if(sizeof(arr))
zero = arr[-1]; zero = arr[-1];
...@@ -108,8 +108,6 @@ mixed foldr(function fun, array arr, mixed|void zero) ...@@ -108,8 +108,6 @@ mixed foldr(function fun, array arr, mixed|void zero)
return zero; return zero;
} }
function reduce = foldl;
array shuffle(array arr) array shuffle(array arr)
{ {
int i = sizeof(arr); int i = sizeof(arr);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment