Naming style
In the terminalela --spec naming-style
Every name a script declares follows one style, so a reader tells what a name is where it is used:
| Kind | Style | Example |
|---|---|---|
| constants | UPPER_CASE | ORG :: "Hyperquader-Coders" |
| enum members, which are constants | UPPER_CASE | Mode.FAST, Type.NUMBER |
| struct and enum names | Capitalised | struct Host, enum Mode |
| variables, procs, parameters, results, fields, import names | snake_case | run_no, makehub_ask, import git "git.ela" |
- A name holds
_, never-, sincea-bis arithmetic. A file name may hold-,deploy-web.ela, and its import name follows the table:import deploy_web "deploy-web.ela". - Command words are never checked:
apt-getandkubectlare programs' names. ela --lintwarns of a name off the style and names the fix:the variable maxTries is not in ela's naming style: write max_tries, as every variable is snake_case. A warning, so the script runs.ela --fmtnever renames, since a rename changes every use, in other files too. An editor's rename throughela --lspchanges the name and every use in the files it knows (EDITORS.md).
ORG :: "Hyperquader-Coders" enum Mode; FAST; SAFE struct Host name: string run_no: numberend struct proc makehub_ask(host: Host, mode: Mode) -> (state: string, run_no: number) return "passed", $host.run_noend proc