I'm a big fan of using conditionals inside my functions to deal with cases, that is, to pattern match in stages and possibly leave a function unevaluated.
In:= f[x_] := ( ( ( True ) /; EvenQ[x] ) /; x > 2 ) /; x < 10 In:= f Out= True
However I don't fully understand the extent to which I can do this. For example, mixing If statements in doesn't work:
In:= h[x_] := ( If[x > 2, ( True ) /; EvenQ[x] , False ] ) /; x < 10 In:= h Out= True /; EvenQ
A clarification on both the limitation and merits of this style of coding would be helpful.
I find this style of programming to be handy for a number of reasons, but a primary reason is the ease of defining a blanket default case and letting the pattern matching do its work, e.g.
f[_] := $Failed.