arche-body
What it means#
A Python body that says only what the action language says (archec vet): written as a ```arche body, archec checks it and translates it to C, Rust and Go. The quick fix converts it.
Example#
Some Python bodies do only what the action language does: if, goto, send,
return, assignments, comparisons, wait, log, and calls to the part's
functions. Such a body reads better as a ```arche body. archec then
checks it, and translates it to C, Rust and Go, not only to Python.
The quick fix Convert to arche body writes it, and so does
archec fix --only arche-body. A body that does more is left as Python: a list,
a library, a name the model does not declare.
How to fix it#
The message says what is wrong and where, and often what was meant (Did you mean …?). Change the model so that what this page describes no longer holds, then check again: archec check main.arche.
A hint: a suggestion; the model builds as it is.
A style finding: archec vet reports it, archec check does not; archec fmt --write writes the layout ones.
archec check --beginner says the most common messages in plain words, with the names that exist.
The automatic fix#
A Python body that says only what the action language can say is rewritten as a ```arche body. For example self.state == "Ready" → state == Ready, await goto("Auto") → goto Auto, send(self.p, M(f=1)) → send p M { f: 1 }. The fix is refused when the body does more: a list that grows, a library call, a name the model does not have. It is a style finding, so only archec fix --vet or --only arche-body applies it.
It guesses what to write, or removes something: VS Code offers it (Quick Fix), and archec fix leaves it unless you name its code — archec fix main.arche --only arche-body.
In the terminal#
archec explain arche-body prints this explanation; archec explain style lists the codes of its area.