Identifiers
Identifiers are the names assigned to user-defined variables and functions:
- They must start with an uppercase (A-Z) or lowercase (a-z) letter, or an underscore (_).
- The following characters can be letters, underscores, or digits (0-9).
- They are case-sensitive.
Here are some examples:
myVar
_myVar
my123Var
functionName
MAX_LEN
max_len
maxLen
3barsDown // NOT VALID!
The Lipi Script Style Guide recommends using uppercase SNAKE_CASE for constants, while camelCase should be used for other identifiers.
GREEN_COLOR = #4CAF50
MAX_LOOKBACK = 100
int fastLength = 7
// Returns 1 if the argument is `true`, 0 if it is `false` or `na`.
zeroOne(boolValue) => boolValue ? 1 : 0