← All categories
- Q61: How do if/else statements work in EK9?
- Q62: How do I chain multiple if/else-if conditions?
- Q63: How does switch/case work in EK9?
- Q64: How do I write a for loop over a range of numbers?
- Q65: How do I use a for loop to iterate over a collection?
- Q66: How does the while loop work?
- Q67: How does do-while work in EK9?
- Q68: Can switch return a value (switch as expression)?
- Q69: How do I match multiple values in one case?
- Q70: How do I use comparison operators in switch cases?
- Q71: How do pattern matching and regex work in switch?
- Q72: What are given/when — alternative switch keywords?
- Q73: How does exhaustive enum switch work?
- Q74: How do guard variables work in if statements?
- Q75: How do guard variables work in switch statements?
- Q76: How do guard variables work in for loops?
- Q77: How do guard variables work in while loops?
- Q78: How do guard variables work in try blocks?
- Q79: What is the guarded assignment operator :=? in EK9?
- Q80: Can a for-range loop return a value (for-range as expression)?
- Q81: Can while and do-while loops return values (loop expressions)?
- Q82: Can a for-in loop return a value (for-in as expression)?
- Q83: Which control flow constructs can be used as expressions in EK9?
- Q144: Why doesn't EK9 have break, continue, or return statements?
- Q145: How do I exit a loop early or skip iterations in EK9?
- Q146: How do I structure functions without early return in EK9?
- Q147: Why doesn't EK9 have switch fallthrough and how do I group cases?
- Q148: How do I migrate complex control flow from Java or Python to EK9?
- Q748: How do I migrate Swift control flow patterns to EK9?
- Q759: How do I use a guard expression as a standalone assignment that returns Boolean?
- Q760: How do I use guarded assignment :=? on an external object field?
- Q782: When does a switch need a returning block in EK9?
- Q788: Why does a switch expression require a default case in EK9?
- Q792: Why must a switch on an enumeration cover all values?
- Q836: Why can't I use compound assignment like '+=' in a switch pre-flow in EK9?
- Q837: Can I use a guard (including '?=') inside a switch or loop expression in EK9?
- Q901: Can switch be used as an expression in EK9?
- Q902: How do try/catch/finally work in EK9?
- Q932: Can I catch multiple exception types in one catch block in EK9?
- Q933: What happens if I write code after a throw statement in EK9?
- Q934: When should I use try/finally without catch in EK9?
- Q935: Can I nest try/catch blocks in EK9?
- Q938: How do I declare the return variable inside a switch expression in EK9?
- Q971: How do guard expressions work in EK9 if statements?
- Q973: How do I declare a variable inside an if condition in EK9?
- Q975: Can guard expressions be used in switch and while, not just if?
- Q984: How do I assign a value based on a condition in EK9?
- Q985: How do I provide a default value when something might be unset in EK9?
- Q991: Trace the execution flow through these guard expressions. What values get printed?
- Q1021: How do I skip items in a loop in EK9 without continue?
- Q1022: Can I use guard expressions in switch statements and while loops, not just if?
- Q1023: What is the difference between :=, ?=, and :=? guard operators in EK9?
- Q1024: How does the ?= guarded assignment protect against unset values in control flow?
- Q1025: How do := and :=? work differently as guard operators in EK9 control flow?
- Q1038: How do I try multiple configuration sources and use the first one that has a value?
- Q1039: When do I use <- and when do I use :=? to set a variable safely?
- Q1146: Assign a value from a function only if it returns a set result, using a guard.
- Q1147: Dispatch on Shape type to produce a description for Circle, Square, and Triangle.
- Q1148: Iterate from 10 down to 1 using a descending for-range.
- Q1149: Iterate from 0 to 20 with a step of 5 using for-range with by.
- Q1150: Loop while a connection value remains set, processing each iteration.
- Q1151: Map a day of the week to 'weekday' or 'weekend' using a switch with multiple case values.
- Q1152: Set a default port only if one has not already been provided.
- Q1153: Assign different labels based on a score using if/else.
- Q1154: Catch an exception from a division operation and handle it.
- Q1155: Run cleanup code after a try block regardless of whether an exception occurred.
- Q1156: Catch an exception in an inner try block so the outer catch does not fire.
- Q1157: Guard a try block so it only runs when the guard value is set.
- Q1196: How do I guard a date lookup so the block only runs if a date is found?
- Q1201: Check if a project has a deadline set, and warn if it is in the past.
- Q1206: Categorise a dimension measurement as small, medium, or large using named thresholds.
- Q1220: Set a default user name only if no name has been provided.
- Q1221: Apply a default port number only when the config port is unset.
- Q1222: Set a fallback deadline only if no deadline was specified.
- Q1223: Apply a minimum price only if the product price hasn't been set.
- Q1224: Set a default tax rate only when the rate hasn't been configured.
- Q1225: Apply a default session timeout only if no timeout was set.
- Q1318: Why does EK9 say a return is not possible when all branches throw?
- Q1354: How do I use a guard in the expression form of a while loop?
- Q1355: How do guards work in a do/while loop, in both statement and expression form?
- Q1356: How do I use a guard in a for-range loop, including the expression form?
- Q1357: How do I use a guard in a for-in loop, including the expression form?
- Q1358: How do I use a ?= or :=? guard in a try, in both statement and expression form?
- Q1359: How do I use a :=? assign-if-unset guard in a switch expression?
- Q1360: What is the ternary operator in EK9 and how do its ':' and 'else' forms differ?
- Q1361: Do guard variables work the same way in every expression-form control-flow construct?