test, examples: lang: Add new syntax for map lookup

Sugar at last!
This commit is contained in:
James Shubin
2023-10-17 15:32:13 -04:00
parent ea0af4dc43
commit 96093984e4
10 changed files with 18 additions and 23 deletions

View File

@@ -2,7 +2,7 @@ import "world"
$ns = "estate"
$exchanged = world.kvlookup($ns)
$state = map_lookup_optional($exchanged, $hostname, "default")
$state = $exchanged[$hostname] || "default"
if $state == "one" or $state == "default" {