Files
mgmt/lang/interpret_test/TestAstFunc2/map-iterator4.txtar
James Shubin 29eebd0d07 lang: core: Move template to golang namespace
I don't think this template function should be in any way authoritative,
so let's namespace it.
2024-09-13 15:51:24 -04:00

18 lines
317 B
Plaintext

-- main.mcl --
import "golang"
import "iter"
$ins = ["a", "bb", "ccc", "dddd", "eeeee",]
# the inline lambda format is more readable with the func as the second arg
$out = iter.map($ins, func($x) {
len($x)
})
$t = golang.template("out: {{ . }}", $out)
test "${t}" {}
-- OUTPUT --
Vertex: test[out: [1 2 3 4 5]]