LearnMusi for DevelopersMusi for C DevelopersValues, Functions, and Expressions

Values, Functions, and Expressions

Read Values, Functions, and Expressions as a C99 habit shift, with links to the Musi Book definition.

C often splits a tiny calculation across declarations because headers and prototypes shape the file. In Musi, the receipt total can be the function body itself when no pointer or status channel is involved.

c
int receipt_total(int latte_cents, int croissant_cents) {
    return latte_cents + croissant_cents;
}

int total = receipt_total(450, 120);

Reading Values, Functions, and Expressions from C99

On the Musi side, Musi lets a calculation be a let, a function, or a final expression without wrapping it in an object or framework first. Read the shared example through C99 eyes: keep the useful instinct, then let Musi name shape, behavior, absence, and outside work in separate places.

False friend

Do not preserve call ceremony just because the source language needs it for methods, receivers, overloads, or closures. For a C reader, the trap is treating convention as a contract; Musi class is not a C struct with function pointers; records/data carry shape, classes name behavior a type can provide.

When this pays off

Use this shape when a receipt total, label, distance, or score is pure data moving through named calls. The C99 instinct still helps here: Keep the C habit of asking where memory, symbols, and failures come from.

Keep close