LearnMusi for DevelopersMusi for Lua DevelopersArrays, Sequences, Maps, and Pipelines

Arrays, Sequences, Maps, and Pipelines

Read Arrays, Sequences, Maps, and Pipelines as a Lua habit shift, with links to the Musi Book definition.

A Lua reader brings habits from tables, metatables, nil, coroutines, embedding, modules, and small runtime boundaries. That helps with simple data and host/runtime edges without much ceremony, but the Musi page asks a narrower question: what contract should this lists, slices, maps, and pipelines example make visible?

lua
local prices = {450, 120, 80}
local first_price = prices[1]

Reading Arrays, Sequences, Maps, and Pipelines from Lua

On the Musi side, Musi collection examples keep indexing, field access, and pipelines explicit so a reader can see where each value comes from. Read the shared example through Lua eyes: keep the useful instinct, then let Musi name shape, behavior, absence, and outside work in separate places.

False friend

Do not import lazy iterators, stream chains, table conventions, or pointer arithmetic unless the Musi example needs that behavior. For a Lua reader, the trap is letting table shape, missing fields, and behavior conventions blur together; Musi class is not a metatable pattern; records/data hold table-like shape, classes/instances name promised behavior.

When this pays off

Use this shape for prices, stops, animals, files, and other small batches where each step has a name. The Lua instinct still helps here: Keep the Lua habit of using small names and simple values.

Keep close