lang: funcs: core: iter: Add map iterator function part2
This adds the Unify method to our map function and also switches the arg order because I decided it would look nicer. Completely untested.
This commit is contained in:
13
lang/interpret_test/TestAstFunc2/map-iterator4/main.mcl
Normal file
13
lang/interpret_test/TestAstFunc2/map-iterator4/main.mcl
Normal file
@@ -0,0 +1,13 @@
|
||||
import "iter"
|
||||
|
||||
$in = ["a", "bb", "ccc", "dddd", "eeeee",]
|
||||
|
||||
# the inline lambda format is more readable with the func as the second arg
|
||||
$out = iter.xmap($in, func($x) {
|
||||
len($x)
|
||||
|
||||
}) # XXX: change to map
|
||||
|
||||
$t = template("out: {{ . }}", $out)
|
||||
|
||||
test $t {}
|
||||
Reference in New Issue
Block a user