E01074: semicolons are not needed in EK9 - uses indentation-based syntax like Python
What went wrong
Semicolons are not used in EK9.
Worked examples
Compilable examples demonstrating this error and the correct fix:
- ek9 -q 786 (Which keywords from other languages are excluded from EK9?)
Rationale
EK9 uses indentation-based syntax (like Python):
- Cleaner, more readable code
- Eliminates "missing semicolon" errors
- Indentation naturally shows code structure
How to fix it
Simply remove the semicolon. EK9 uses newlines and indentation for structure.
See also
- E01070: 'break' not supported (use stream pipelines with 'head')
- E01071: 'continue' not supported (use stream pipelines with 'filter')
- E01072: 'return' not supported (use return declarations)
- E01073: 'null' not supported (use tri-state semantics)
- E01074: semicolons not needed (indentation-based syntax)
https://ek9.io/basics.html#indentation https://ek9.io/forAI.json#$.excludedFeatures.features[?(@.keyword==";")]
Examples
Every example is compiled by the EK9 compiler: the first fails exactly as captioned, the others fix it.
Fails with E01074: semicolons are not needed in EK9 - uses indentation-based syntax like Python
#!ek9 defines module error.e01074.bad defines function trySemicolonAfterAssignment() name <- "Steve"; trySemicolonAfterCall() stdout <- Stdout() stdout.println("Hello"); trySemicolonAfterIncrement() count <- 0 count++;
Fixed: Remove the semicolons: one statement per line
#!ek9 defines module error.e01074.good defines function greet() name <- "Steve" stdout <- Stdout() stdout.println("Hello " + name) countUp() <- count as Integer: 0 count++
Questions and answers
These Q&A entries show E01074 and its fix: