Control Structures
These are examples of control structures. You may also be interested in:

 Conditional structures
 Exceptions
 Flow-control structures
 Loops

Task

List the conditional structures offered by a programming language. See Wikipedia: conditionals for descriptions.

Common conditional structures include if-then-else and switch.

Less common are arithmetic if, ternary operator and Hash-based conditionals.

Arithmetic if allows tight control over computed gotos, which optimizers have a hard time to figure out.



 
--if-then-elseif-then-else
if a then
  b()
elseif c then
  d()
else
  e()
end
 
for var = start, _end, step do --note: end is a reserved word
  something()
end
 
for var, var2, etc in iteratorfunction do
  something()
end
 
while somethingistrue() do
  something()
end
 
repeat
  something()
until somethingistrue()
 
cases = {
key1 = dothis,
key2 = dothat,
key3 = dotheother
}
 
cases[key]() --equivalent to dothis(), dothat(), or dotheother() respectively