6.3 Standard Enumeration Types: Boolean - JulTob/Ada GitHub Wiki

Boolean


type Boolean is (False, True);

------

Flag : Boolean := True

Boolean Functions


and
or
not
xor
/=
=


and then  --Stops when a false is found
or else   --Stops when a true is found

in   -- Belongs to a set type

And then also can prevent from executing "dangerous" code.


if a /= 0 and then b/a > 5.0 then ...

Also, Ada will not allow an unparenthesied expression to contain both and's and or's.

Examples

Return Reply_Char IN 'Y' | 'y'; -- TRUE just if Y or y
EXIT WHEN Reply IN 'Y' | 'y' | 'N' | 'n';
If char IN 'a'..'z' then;