ncbag·há 2 anos·discussYes, the following is so easy in OCaml, it would be a major undertaking in Python: type committer = InnerCircle of string | NPC of string | Dissenter of string ;; type coc_reaction = DoNothing | ThreeMonthsWithoutHumiliation | PublicDefamation ;; let adjudicate = function InnerCircle _ -> DoNothing | NPC _ -> ThreeMonthsWithoutHumiliation | Dissenter _ -> PublicDefamation ;; # adjudicate (InnerCircle "Wouters");; - : coc_reaction = DoNothing # adjudicate (Dissenter "Peters");; - : coc_reaction = PublicDefamation Just use another language, also for social and professional reasons.
Just use another language, also for social and professional reasons.