lang: core: map: Add functions to extract keys and values
Simple stuff, but now it's done!
This commit is contained in:
21
examples/lang/map-kv.mcl
Normal file
21
examples/lang/map-kv.mcl
Normal file
@@ -0,0 +1,21 @@
|
||||
import "fmt"
|
||||
import "map"
|
||||
|
||||
$some_map = {
|
||||
"ottawa" => 6,
|
||||
"toronto" => 7,
|
||||
"montreal" => 8,
|
||||
"vancouver" => 9,
|
||||
}
|
||||
|
||||
print "keys" {
|
||||
msg => fmt.printf("keys: %v", map.keys($some_map)),
|
||||
|
||||
Meta:autogroup => false,
|
||||
}
|
||||
|
||||
print "values" {
|
||||
msg => fmt.printf("values: %v", map.values($some_map)),
|
||||
|
||||
Meta:autogroup => false,
|
||||
}
|
||||
Reference in New Issue
Block a user