lang: core: Simplify list and map lookup functions

This commit is contained in:
James Shubin
2025-02-26 19:22:49 -05:00
parent 37fffce9f5
commit d579787bcd
4 changed files with 77 additions and 353 deletions

22
examples/lang/lookup.mcl Normal file
View File

@@ -0,0 +1,22 @@
import "fmt"
$some_list = ["l", "m", "n",]
$some_map = {
"ottawa" => 6,
"toronto" => 7,
"montreal" => 8,
"vancouver" => 9,
}
print "letter" {
msg => fmt.printf("letter: %s", $some_list[1]),
Meta:autogroup => false,
}
print "city" {
msg => fmt.printf("city: %d", $some_map["montreal"]),
Meta:autogroup => false,
}