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-iterator0/main.mcl
Normal file
13
lang/interpret_test/TestAstFunc2/map-iterator0/main.mcl
Normal file
@@ -0,0 +1,13 @@
|
||||
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.xmap($in1, $fn) # XXX: change to map
|
||||
|
||||
$t1 = template("out1: {{ . }}", $out1)
|
||||
|
||||
test $t1 {}
|
||||
Reference in New Issue
Block a user