Sadly this doesn't all work yet, but the tests and xmap function are approximately correct. Eventually we add filter and reduce too!
14 lines
173 B
Plaintext
14 lines
173 B
Plaintext
import "iter"
|
|
|
|
$fn = func($x) { # ignore arg
|
|
42
|
|
}
|
|
|
|
$in = [5, 4, 3, 2, 1,]
|
|
|
|
$out = iter.xmap($fn, $in) # XXX: change to map
|
|
|
|
$t = template("out: {{ . }}", $out)
|
|
|
|
test $t {}
|