# Ordering of conditions in multi-way conditional constructs [closed]

Most programming languages provide multi-way conditional constructs (like cond in Lisp, guards in Haskell, etc) that allow one to define program behavior according to different conditions. But most of them also implies a default top-down ordering: the next condition is checked only when all preceding conditions are unsatisfied. I wonder if there is any work on conditional constructs that does not follow this convention but rather automatically sort the conditions according to some order. I can foresee how hard it is to get conditions independent. Maybe it is not feasible anyway?

## closed as unclear what you're asking by D.W.♦, FrankW, lPlant, Wandering Logic, vonbrandJul 25 '14 at 19:15

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• Can you be more specific about what your question is? It is certainly possible to define a different sort of multi-way conditional construct. If you are asking for a language with that construct, that's probably off-topic -- requests for language recommendations are probably off-topic. (There are also languages with multi-way conditionals where the conditionals must be disjoint.) If you are asking if it is possible to define such a construct, it is certainly possible; many languages will even let you define your own control structure. Can you articulate a more narrowly scoped question? – D.W. Jul 16 '14 at 22:56
• Dijkstra's Guarded Programming Language has such an if, one of the true branches is selected at random. – vonbrand Jul 25 '14 at 19:15