This was the goal all along. Proper iteration without for loops. Yay! Co-authored-by: Samuel Gélineau <gelisam@gmail.com>
14 lines
231 B
Plaintext
14 lines
231 B
Plaintext
import "iter"
|
|
|
|
$fn = func($x) { # notable because concrete type is fn(t1) t2, where t1 != t2
|
|
len($x)
|
|
}
|
|
|
|
$in1 = ["a", "bb", "ccc", "dddd", "eeeee",]
|
|
|
|
$out1 = iter.map($in1, $fn)
|
|
|
|
$t1 = template("out1: {{ . }}", $out1)
|
|
|
|
test $t1 {}
|