soma.cell

A helper in a flesh is _private and typed

Pitfall 29 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 Shop {
    face { signal quote(n: Int) -> Int }
}
flesh Shop {
    on quote(n) { return triple(n) }
    on triple(k: Int) { return k * 3 }
}
// error: `triple` is not a signal of `skeleton Shop` — a handler the face does not declare
//        is a private helper, and a private handler is named with a leading underscore
skeleton Shop {
    face { signal quote(n: Int) -> Int }
}
flesh Shop {
    on quote(n) { return _triple(n) }
    on _triple(k: Int) { return k * 3 }
}

A signal's parameters take their types from the skeleton (on quote(n)); a helper has no signal, so it declares its own (k: Int).