parent
ca76ae5b80
commit
9e90bdfc33
1 changed files with 3 additions and 5 deletions
|
|
@ -1,11 +1,9 @@
|
||||||
|
|
||||||
fn (l: list) map(list: [any], f: fn(any) -> any) -> [any] {
|
fn<T, R> ([T]) map(f: fn(T) -> R) -> [R] {
|
||||||
out := []
|
out := []
|
||||||
|
|
||||||
i := 0
|
for v in list.iter() {
|
||||||
while i < list.length() {
|
out.append(f(v))
|
||||||
out.append(f(list.at(i)))
|
|
||||||
i = i + 1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return out
|
return out
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue