A common pattern you see in programs are predicates such as is_action_allowed(), or should_perform_action(), taking a constant value, often from an enumerated type, and returning a boolean value. A straightforward way to implement such predicates is to write a function like so: