Added Sequence.any as complement to Sequence.all

This commit is contained in:
Thorbjørn Lindeijer
2015-03-01 23:14:32 +01:00
parent e72eedc6f5
commit 8f985847d4
6 changed files with 40 additions and 2 deletions
+7
View File
@@ -67,6 +67,13 @@ static const char* libSource =
" return true\n"
" }\n"
"\n"
" any(f) {\n"
" for (element in this) {\n"
" if (f.call(element)) return true\n"
" }\n"
" return false\n"
" }\n"
"\n"
" reduce(acc, f) {\n"
" for (element in this) {\n"
" acc = f.call(acc, element)\n"