Files
mgmt/lang/interpret_test/TestAstFunc2/map-iterator2/main.mcl
James Shubin 0be4b86230 lang: funcs: core: iter: Add map iterator function
Sadly this doesn't all work yet, but the tests and xmap function are
approximately correct. Eventually we add filter and reduce too!
2022-08-04 14:23:16 -04:00

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 {}