16 lines
223 B
Text
16 lines
223 B
Text
let map = fn(f,array) {
|
|
let mut index = 0
|
|
loop {
|
|
if index >= array.len {
|
|
break
|
|
}
|
|
array.index = f(array.index)
|
|
index = index + 1
|
|
}
|
|
array
|
|
}
|
|
|
|
let main = fn() {
|
|
map(fn (x) { x + 1 }, [1,2,3])
|
|
}
|
|
|