soma.cell

Structure goes in the skeleton, bodies in the flesh

Pitfall 28 of writing Soma, the programming language: a habit from another language, or a rule that surprises, with what the Soma compiler answers and the form to write.

skeleton Counter {
    face { signal total() -> Int }
    on total() { return 1 }
}
// error: a skeleton has no handler bodies — declare the signal in `face { }` with its
//        frame, and put the body in `flesh Counter { on … { … } }`
skeleton Counter {
    face { signal total() -> Int }
}
flesh Counter {
    on total() { return 1 }
}

The other way round is refused too: a flesh holds on handlers only — no memory, state or face. A plain cell still holds both.