recipes · recipe ·

Find things by name

Choose between a list, a map, and a set.

cpurecipe

A list is useful when you want the first, second, and third item. Sometimes you want the price of an apple without caring where apples sit in a list. A map connects a key, such as a name, to a value. A set answers a different question: have we already collected this badge? Adding the same badge twice does not make two badges. These collection features are experimental; use the supplied compiler route and check your target before shipping.

start.yh

Status: complete-program

Find things by name

Choose between a list, a map, and a set.

cpu · type checked

map of text to int prices = ["apple" to 3, "berry" to 2]
if prices.Contains("apple")
{
    Console.Log(Text.From(prices["apple"]))
}

set of text badges
badges.Add("explorer")
badges.Add("explorer")
Console.Log(Text.From(badges.count))
project.mech
manifestVersion = "2"
package = "api.example.recipe__lookup"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"
Expected output
3
1
Notes and source

Add a pear price and ask for it. Then check for a missing key before trying to print its value.

demonhunterlabs/app/lib/yeho-walkthrough.ts