ela
Contents

ManualLanguage

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:

KindStyleExample
constantsUPPER_CASEORG :: "Hyperquader-Coders"
enum members, which are constantsUPPER_CASEMode.FAST, Type.NUMBER
struct and enum namesCapitalisedstruct Host, enum Mode
variables, procs, parameters, results, fields, import namessnake_caserun_no, makehub_ask, import git "git.ela"
  • A name holds _, never -, since a-b is 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-get and kubectl are programs' names.
  • ela --lint warns 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 --fmt never renames, since a rename changes every use, in other files too. An editor's rename through ela --lsp changes 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