language · language ·

Maps

map of K to V associates typed keys with typed values. Map literals use key to value pairs.

ContainsRemovecollectionscpulanguagemapoftoyeho

Use a map for lookup by identity or name when sequential scanning would hide the intent.

map of KeyType to ValueType
[key to value, key to value]
map[key]

Status: experimental

Lookup table

Use a map for lookup by identity or name when sequential scanning would hide the intent.

cpu · language · type checked

map of text to int power = ["sun" to 100, "moon" to 70]
int sunPower = power["sun"]

if power.Contains("moon")
{
    Console.Log(Text.From(power["moon"]))
}
project.mech
manifestVersion = "2"
package = "api.example.language__maps"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"
Notes and source

Map literals and list literals both use brackets; to distinguishes a map pair.

Collections are experimental.

yeho/parser_types.cpp parseMapTypeRef; parser_expressions.cpp parseListOrMapLiteralExpression