Introduce some new standard library modules

This commit is contained in:
2020-03-14 17:07:04 +01:00
parent 8ee3195bef
commit 5dd703682a
13 changed files with 229 additions and 2 deletions

View File

@@ -15,7 +15,7 @@ function _flatten(list: list, output: list) {
}
extend list as this {
function toFlat() {
function flatten() {
return flatten(this);
}
@@ -23,6 +23,16 @@ extend list as this {
return (this as item ^ item % item == value).size > 0;
}
function indexOf(value) {
this as (item, index) ^ {
if(item == value) {
return index;
}
}
return -1;
}
function join(separator: string = ", ") {
output = ""
this as (item, index) ^ {