In Prolog predicates, I often write repetitive conditional statements like this one, but I wish they could be written more concisely:
output(Lang, Type, Output) :-
(Lang = javascript ->
Output = ["function", Type];
Lang = ruby ->
Output = ["def", Type];
Lang = java ->
Output = [Type]).
Would it be possible to replace this series of conditional statements with a more concise switch-statement?