Is there any difference at all between
f[x_Integer /; x >= 0] := x + 1;
f[x_Integer] := x - 1;
f[x_] := Null;
and
f[x_Integer] := x + 1 /; x >= 0;
f[x_Integer] := x - 1;
f[x_] := Null;
The output is identical in both the cases. Even if there is no technical difference, is it common practice to adhere one and avoid the other?
(Print["Hi"];...), then call each with -1 - the first will return unevaluated, the second evaluates the print. In your specific example, the end result is the same. – ciao Jun 01 '14 at 21:49Conditionis used insideWithorModule. (As I mention here.) – Mr.Wizard Jul 08 '14 at 08:19