A loop that tries to break out
The complete source of flowControl_break.ek9, which fails to compile exactly as captioned. Shown on flowControl.html.
Fails with E01070: 'break' does not exist in EK9 - use stream pipelines with 'head' or guards
#!ek9 defines module bad.site.flowControl.breakloop defines function startsWithA() as pure -> item as String <- rtn as Boolean: item matches /^A.*/ defines program FirstMatchWithBreak() stdout <- Stdout() items <- ["Beta", "Alpha", "Avocado"] found <- false for item in items if startsWithA(item) found: true break stdout.println(found)
Download flowControl_break.ek9 - it fails to compile on purpose, with the error its @Error line states.