I am reading sensor frames into an array and check an index before using it: if Index in Buffer'Range and Buffer (Index) = 0 then. It compiles, but with a bad index the program raises Constraint_Error on that very line, although I thought the first test would protect the second. Other code I have seen uses and then in the same place.
What exactly is the difference between and and and then (and between or and or else), and why does Ada have both instead of always short-circuiting like C does with &&?




