I don't think this template function should be in any way authoritative, so let's namespace it.
18 lines
312 B
Plaintext
18 lines
312 B
Plaintext
-- main.mcl --
|
|
import "golang"
|
|
import "iter"
|
|
|
|
$fn = func($x) { # notable because concrete type is fn(t1) t2, where t1 != t2
|
|
len($x)
|
|
}
|
|
|
|
$ins = ["a", "bb", "ccc", "dddd", "eeeee",]
|
|
|
|
$out = iter.map($ins, $fn)
|
|
|
|
$t = golang.template("out: {{ . }}", $out)
|
|
|
|
test "${t}" {}
|
|
-- OUTPUT --
|
|
Vertex: test[out: [1 2 3 4 5]]
|